1
0
mirror of synced 2025-01-18 14:31:40 +03:00

[2.0] DDC-454 - ForeignKey problems when several new tables are found in SchemaDiff::toSql

This commit is contained in:
beberlei 2010-03-21 11:57:07 +00:00
parent 5018985807
commit fcbe01f800

View File

@ -149,12 +149,17 @@ class SchemaDiff
}
}
$foreignKeySql = array();
foreach ($this->newTables AS $table) {
$sql = array_merge(
$sql,
$platform->getCreateTableSQL($table, AbstractPlatform::CREATE_FOREIGNKEYS|AbstractPlatform::CREATE_INDEXES)
$platform->getCreateTableSQL($table, AbstractPlatform::CREATE_INDEXES)
);
foreach ($table->getForeignKeys() AS $foreignKey) {
$foreignKeySql[] = $platform->getCreateForeignKeySQL($foreignKey, $table);
}
}
$sql = array_merge($sql, $foreignKeySql);
if ($saveMode === false) {
foreach ($this->removedTables AS $table) {