Which database server are you using?
Apr 5, 2016
7
Level 3
Can't drop column with dropColumn()
Hey I want to remove the column age from the table users.
When running php artisan migrate it returns:
nothing to migrate
Here's my migration. How do I remove this column?
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('username',20);
$table->string('email')->unique();
$table->string('password', 60);
$table->rememberToken();
$table->timestamps();
$table->dropColumn('age');
});
}
Level 104
Should I create a migration just for dropping the 'age' column - that's what I understand from you.
Correct
1 like
Please or to participate in this conversation.