Skip to content

Commit

Permalink
Fix bug with CamelCase table names
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepablos authored and beberlei committed Oct 5, 2012
1 parent 7b6860d commit 78d9cc8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/Doctrine/DBAL/Schema/Comparator.php
Expand Up @@ -99,9 +99,11 @@ public function compare(Schema $fromSchema, Schema $toSchema)
// deleting duplicated foreign keys present on both on the orphanedForeignKey
// and the removedForeignKeys from changedTables
foreach ($foreignKeysToTable[$tableName] as $foreignKey) {
if (isset($diff->changedTables[$foreignKey->getLocalTableName()])) {
foreach ($diff->changedTables[$foreignKey->getLocalTableName()]->removedForeignKeys as $key => $removedForeignKey) {
unset($diff->changedTables[$foreignKey->getLocalTableName()]->removedForeignKeys[$key]);
// strtolower the table name to make if compatible with getShortestName
$localTableName = strtolower($foreignKey->getLocalTableName());
if (isset($diff->changedTables[$localTableName])) {
foreach ($diff->changedTables[$localTableName]->removedForeignKeys as $key => $removedForeignKey) {
unset($diff->changedTables[$localTableName]->removedForeignKeys[$key]);
}
}
}
Expand Down

0 comments on commit 78d9cc8

Please sign in to comment.