1
0
mirror of synced 2024-12-13 22:56:04 +03:00

Merge branch 'DBAL-115'

This commit is contained in:
Benjamin Eberlei 2011-04-30 16:20:32 +02:00
commit abbb3e8656

View File

@ -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);
}
}
}