Skip to content

Commit d1ee40e

Browse files
authored
Merge pull request #11908 from xabbuh/dbal-6674
use the platform to quote table names
2 parents 3e18a58 + d659591 commit d1ee40e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tests/Tests/OrmFunctionalTestCase.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Doctrine\DBAL\Platforms\OraclePlatform;
1111
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
1212
use Doctrine\DBAL\Schema\AbstractSchemaManager;
13+
use Doctrine\DBAL\Schema\NamedObject;
1314
use Doctrine\DBAL\Schema\Schema;
1415
use Doctrine\DBAL\Schema\Table;
1516
use Doctrine\DBAL\Types\Type;
@@ -1104,7 +1105,12 @@ protected function dropAndCreateTable(Table $table): void
11041105
{
11051106
$schemaManager = $this->createSchemaManager();
11061107
$platform = $this->_em->getConnection()->getDatabasePlatform();
1107-
$tableName = $table->getQuotedName($platform);
1108+
1109+
if ($table instanceof NamedObject) {
1110+
$tableName = $table->getObjectName()->toSQL($platform);
1111+
} else {
1112+
$tableName = $table->getQuotedName($platform);
1113+
}
11081114

11091115
$this->dropTableIfExists($tableName);
11101116
$schemaManager->createTable($table);

0 commit comments

Comments
 (0)