Got this error while trying to run tests using in memory SQLite database. Here is what my previous migration looked like
public function down()
{
Schema::table('my_table', function (Blueprint $table) {
$table->dropColumn('column_one');
$table->dropColumn('column_two');
});
}
The fix is to change migration a bit and should look something like this when you are dropping columns
public function down()
{
Schema::table('my_table', function (Blueprint $table) {
$table->dropColumn(['column_one', 'column_two']);
});
}
When you are renaming columns the only fix I have found so far is given below. If you found a better fix please add that on the comment.
// This is your old migration code
Schema::table('my_table', function (Blueprint $table) {
$table->renameColumn('name_one', 'name_two');
$table->renameColumn('name_three', 'name_four');
});
To fix rename column issue, you need to use Schema twice like this
// This is your old migration code
Schema::table('my_table', function (Blueprint $table) {
$table->renameColumn('name_one', 'name_two');
});
// This is your old migration code
Schema::table('my_table', function (Blueprint $table) {
$table->renameColumn('name_three', 'name_four');
});