You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Laravel 11, running tests in memory using SQLite I receive this error when trying to drop a column that have a foreign key on it. That wasn't a problem before when using doctrine/dbal (#48864).
Steps To Reproduce
Create a new Laravel project.
Add a new migration that drop the user_id column on the sessions table like so:
Schema::table('sessions', function (Blueprint $table) {
$table->dropColumn('user_id');
});
Setup PHPUnit for testing with the connection set to SQLite and the database set to :memory:.
Add use RefreshDatabase; in the default TestCase class
Run the test test_the_application_returns_a_successful_response.
You should receive the following error:
There was 1 error:
1) Tests\Feature\ExampleTest::test_the_application_returns_a_successful_response
Illuminate\Database\QueryException: SQLSTATE[HY000]: General error: 1 error in index sessions_user_id_index after drop column: no such column: user_id (Connection: sqlite, SQL: alter table "sessions" drop column "user_id")
JustinDugas, pawel-omniaz, ocleroux, Simounet, ErickLeal and 3 more