[DBAL-115] Bugfix in SchemaTool not quoting table names when dropping schema.
This commit is contained in:
parent
d72217a00a
commit
1f665e6ba8
@ -617,9 +617,10 @@ class SchemaTool
|
|||||||
$associationTables = $this->_getAssociationTables($commitOrder);
|
$associationTables = $this->_getAssociationTables($commitOrder);
|
||||||
|
|
||||||
// Drop association tables first
|
// Drop association tables first
|
||||||
foreach ($associationTables as $associationTable) {
|
foreach ($associationTables as $quotedAssociationTableName) {
|
||||||
if (!in_array($associationTable, $orderedTables)) {
|
// avoid adding duplicates
|
||||||
$orderedTables[] = $associationTable;
|
if (!in_array($quotedAssociationTableName, $orderedTables)) {
|
||||||
|
$orderedTables[] = $quotedAssociationTableName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -633,7 +634,7 @@ class SchemaTool
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($class->getTableName(), $orderedTables)) {
|
if (!in_array($class->getTableName(), $orderedTables)) {
|
||||||
$orderedTables[] = $class->getTableName();
|
$orderedTables[] = $class->getQuotedTableName($this->_platform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -731,9 +732,10 @@ class SchemaTool
|
|||||||
$associationTables = array();
|
$associationTables = array();
|
||||||
|
|
||||||
foreach ($classes as $class) {
|
foreach ($classes as $class) {
|
||||||
|
/* @var $class \Doctrine\ORM\Mapping\ClassMetadata */
|
||||||
foreach ($class->associationMappings as $assoc) {
|
foreach ($class->associationMappings as $assoc) {
|
||||||
if ($assoc['isOwningSide'] && $assoc['type'] == ClassMetadata::MANY_TO_MANY) {
|
if ($assoc['isOwningSide'] && $assoc['type'] == ClassMetadata::MANY_TO_MANY) {
|
||||||
$associationTables[] = $assoc['joinTable']['name'];
|
$associationTables[] = $class->getQuotedJoinTableName($assoc, $this->_platform);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user