Do not use AbstractPlatform::canEmulateSchemas()

This commit is contained in:
Sergei Morozov
2021-12-16 11:51:40 -08:00
parent f2e34bd172
commit a41c6d32c3
6 changed files with 8 additions and 18 deletions

View File

@@ -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.

View File

@@ -3668,10 +3668,6 @@ class ClassMetadataInfo implements ClassMetadata
$schemaName = $this->getSchemaName();
if ($schemaName) {
$sequencePrefix = $schemaName . '.' . $tableName;
if (! $platform->supportsSchemas() && $platform->canEmulateSchemas()) {
$sequencePrefix = $schemaName . '__' . $tableName;
}
}
return $sequencePrefix;

View File

@@ -41,10 +41,6 @@ class DefaultQuoteStrategy implements QuoteStrategy
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 @@ class DefaultQuoteStrategy implements QuoteStrategy
$schema = '';
if (isset($association['joinTable']['schema'])) {
$schema = $association['joinTable']['schema'];
$schema .= ! $platform->supportsSchemas() && $platform->canEmulateSchemas() ? '__' : '.';
$schema = $association['joinTable']['schema'] . '.';
}
$tableName = $association['joinTable']['name'];

View File

@@ -393,7 +393,7 @@ class SchemaTool
}
}
if (! $this->platform->supportsSchemas() && ! $this->platform->canEmulateSchemas()) {
if (! $this->platform->supportsSchemas()) {
$schema->visit(new RemoveNamespacedAssets());
}

View File

@@ -30,7 +30,7 @@ class DDC2825Test extends OrmFunctionalTestCase
$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.');
}
}

View File

@@ -74,12 +74,7 @@ final class GH7079Test extends OrmFunctionalTestCase
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