Merge branch 'DBAL-115'
This commit is contained in:
commit
abbb3e8656
@ -617,9 +617,10 @@ class SchemaTool
|
||||
$associationTables = $this->_getAssociationTables($commitOrder);
|
||||
|
||||
// Drop association tables first
|
||||
foreach ($associationTables as $associationTable) {
|
||||
if (!in_array($associationTable, $orderedTables)) {
|
||||
$orderedTables[] = $associationTable;
|
||||
foreach ($associationTables as $quotedAssociationTableName) {
|
||||
// avoid adding duplicates
|
||||
if (!in_array($quotedAssociationTableName, $orderedTables)) {
|
||||
$orderedTables[] = $quotedAssociationTableName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -633,7 +634,7 @@ class SchemaTool
|
||||
}
|
||||
|
||||
if (!in_array($class->getTableName(), $orderedTables)) {
|
||||
$orderedTables[] = $class->getTableName();
|
||||
$orderedTables[] = $class->getQuotedTableName($this->_platform);
|
||||
}
|
||||
}
|
||||
|
||||
@ -731,9 +732,10 @@ class SchemaTool
|
||||
$associationTables = array();
|
||||
|
||||
foreach ($classes as $class) {
|
||||
/* @var $class \Doctrine\ORM\Mapping\ClassMetadata */
|
||||
foreach ($class->associationMappings as $assoc) {
|
||||
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