diff --git a/UPGRADE.md b/UPGRADE.md index 6f44c12f17c..82ba1ffbe9f 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -1,5 +1,9 @@ # Upgrade to 3.0 +## BC BREAK: Removed support for schema emulation. + +The ORM no longer attempts to emulate schemas on SQLite. + ## BC BREAK: Remove `Setup::registerAutoloadDirectory()` Use Composer's autoloader instead. diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index 890ddcd0172..487b6af11f3 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -3668,10 +3668,6 @@ public function getSequencePrefix(AbstractPlatform $platform) $schemaName = $this->getSchemaName(); if ($schemaName) { $sequencePrefix = $schemaName . '.' . $tableName; - - if (! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { - $sequencePrefix = $schemaName . '__' . $tableName; - } } return $sequencePrefix; diff --git a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php index cb15aaa95c1..e02d029e508 100644 --- a/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php +++ b/lib/Doctrine/ORM/Mapping/DefaultQuoteStrategy.php @@ -41,10 +41,6 @@ public function getTableName(ClassMetadata $class, AbstractPlatform $platform) if (! empty($class->table['schema'])) { $tableName = $class->table['schema'] . '.' . $class->table['name']; - - if (! $platform->supportsSchemas() && $platform->canEmulateSchemas()) { - $tableName = $class->table['schema'] . '__' . $class->table['name']; - } } return isset($class->table['quoted']) @@ -90,8 +86,7 @@ public function getJoinTableName(array $association, ClassMetadata $class, Abstr $schema = ''; if (isset($association['joinTable']['schema'])) { - $schema = $association['joinTable']['schema']; - $schema .= ! $platform->supportsSchemas() && $platform->canEmulateSchemas() ? '__' : '.'; + $schema = $association['joinTable']['schema'] . '.'; } $tableName = $association['joinTable']['name']; diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 8d9cf1bc814..67885702bfe 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -393,7 +393,7 @@ static function (ClassMetadata $class) use ($idMapping): bool { } } - if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) { + if (! $this->platform->supportsSchemas()) { $schema->visit(new RemoveNamespacedAssets()); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2825Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2825Test.php index e1b1f079630..d677a2e89de 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2825Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC2825Test.php @@ -30,7 +30,7 @@ protected function setUp(): void $platform = $this->_em->getConnection()->getDatabasePlatform(); - if (! $platform->supportsSchemas() && ! $platform->canEmulateSchemas()) { + if (! $platform->supportsSchemas()) { self::markTestSkipped('This test is only useful for databases that support schemas or can emulate them.'); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php index 5f5af547547..c4e7c47756d 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/GH7079Test.php @@ -74,12 +74,7 @@ public function testJoinTableName(): void private function getTableFullName(array $table): string { - $join = '.'; - if (! $this->platform->supportsSchemas() && $this->platform->canEmulateSchemas()) { - $join = '__'; - } - - return $table['schema'] . $join . $table['name']; + return $table['schema'] . '.' . $table['name']; } private function createClassMetadata(string $className): ClassMetadata