Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fogley's avatar

Cannot drop column and add new columns in same migration

I've created a migration that is supposed to drop columns as well as create new ones. When I drop the column, the migration does not add the the columns.

When I remove the dropColumn call, the columns are added just fine. I use SQLite.

Here's the simplified version:

    Schema::table('table', function($table) {
        $table->integer('new_column_name')->nullable();
        $table->dropColumn('old_column_name');
    });
0 likes
2 replies
_Artak_'s avatar

try this



    Schema::table('table', function($table) {
        $table->integer('new_column_name')->nullable();
    });

    Schema::table('table', function($table) {
        $table->dropColumn('old_column_name');
    });


3 likes

Please or to participate in this conversation.