Commit 283ff9b9 authored by Sergi de Pablos's avatar Sergi de Pablos

Fix bug with CamelCase table names

parent 3a1c84e7
...@@ -99,9 +99,11 @@ class Comparator ...@@ -99,9 +99,11 @@ class Comparator
// deleting duplicated foreign keys present on both on the orphanedForeignKey // deleting duplicated foreign keys present on both on the orphanedForeignKey
// and the removedForeignKeys from changedTables // and the removedForeignKeys from changedTables
foreach ($foreignKeysToTable[$tableName] as $foreignKey) { foreach ($foreignKeysToTable[$tableName] as $foreignKey) {
if (isset($diff->changedTables[$foreignKey->getLocalTableName()])) { // strtolower the table name to make if compatible with getShortestName
foreach ($diff->changedTables[$foreignKey->getLocalTableName()]->removedForeignKeys as $key => $removedForeignKey) { $localTableName = strtolower($foreignKey->getLocalTableName());
unset($diff->changedTables[$foreignKey->getLocalTableName()]->removedForeignKeys[$key]); if (isset($diff->changedTables[$localTableName])) {
foreach ($diff->changedTables[$localTableName]->removedForeignKeys as $key => $removedForeignKey) {
unset($diff->changedTables[$localTableName]->removedForeignKeys[$key]);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment