Skip to content

Incorrect behaviour "SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification." #50303

Closed
@Cryborg

Description

@Cryborg

Laravel Version

10.46

PHP Version

8.2

Database Driver & Version

SQLite

Description

In a migration, I have the following code that worked well a few days ago :

    public function down(): void
    {
        Schema::table('answers', function(Blueprint $table) {
            $table->dropColumn('corrected_text');
            $table->dropColumn('options');
            $table->dropColumn('score');
        });
    }

Now, I have this message when I run the tests : "SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification."

The solution I found is this :

    public function down(): void
    {
        Schema::table('answers', function (Blueprint $table) {
            $table->dropColumn('corrected_text');
        });
        Schema::table('answers', function (Blueprint $table) {
            $table->dropColumn('options');
        });
        Schema::table('answers', function (Blueprint $table) {
            $table->dropColumn('score');
        });
    }

But it seems hacky and looks like a regression to me. I updated to 10.46 and I was on 10.40 before.

Steps To Reproduce

Use multiple dropColumns in a migration file, and run unit tests using SQLite DB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions