diff --git a/src/Schema/Migrator.php b/src/Schema/Migrator.php index bcabd57ace..2e830b7a5f 100644 --- a/src/Schema/Migrator.php +++ b/src/Schema/Migrator.php @@ -208,6 +208,8 @@ protected function stripDatabaseFromTableName(string $tableName): string $currentDatabase = $this->getConnection()->dsql() ->field(new Expression($this->getDatabasePlatform()->getCurrentDatabaseExpression(true))) // @phpstan-ignore-line ->getOne(); + } elseif ($platform instanceof SqlitePlatform) { + $currentDatabase = 'main'; } else { $currentDatabase = $this->getConnection()->getConnection()->getDatabase(); } diff --git a/tests/RandomTest.php b/tests/RandomTest.php index d2350ec242..834c2c0a96 100644 --- a/tests/RandomTest.php +++ b/tests/RandomTest.php @@ -596,6 +596,7 @@ public function testTableWithSchema(): void $this->createMigrator($user)->create(); $this->createMigrator($doc)->create(); + $this->debug = true; $this->createMigrator()->createForeignKey($doc->getReference('user_id')); $user->createEntity()