[2.0] DDC-454 - ForeignKey problems when several new tables are found in SchemaDiff::toSql
This commit is contained in:
parent
5018985807
commit
fcbe01f800
@ -149,12 +149,17 @@ class SchemaDiff
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$foreignKeySql = array();
|
||||||
foreach ($this->newTables AS $table) {
|
foreach ($this->newTables AS $table) {
|
||||||
$sql = array_merge(
|
$sql = array_merge(
|
||||||
$sql,
|
$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) {
|
if ($saveMode === false) {
|
||||||
foreach ($this->removedTables AS $table) {
|
foreach ($this->removedTables AS $table) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user