Permalink
Browse files

fixed bug on schema comparitor, prevent multiple rename candidates fo…

…r the same original field
  • Loading branch information...
1 parent 804bd86 commit 1947a85e58b1cca037dc4d5c9edef7221ef94330 @leedavis81 committed Oct 4, 2012
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/Doctrine/DBAL/Schema/Comparator.php
@@ -282,10 +282,13 @@ private function detectColumnRenamings(TableDiff $tableDifferences)
list($removedColumn, $addedColumn) = $candidateColumns[0];
$removedColumnName = strtolower($removedColumn->getName());
$addedColumnName = strtolower($addedColumn->getName());
-
- $tableDifferences->renamedColumns[$removedColumnName] = $addedColumn;
- unset($tableDifferences->addedColumns[$addedColumnName]);
- unset($tableDifferences->removedColumns[$removedColumnName]);
+
+ if (!isset($tableDifferences->renamedColumns[$removedColumnName]))
+ {
+ $tableDifferences->renamedColumns[$removedColumnName] = $addedColumn;
+ unset($tableDifferences->addedColumns[$addedColumnName]);
+ unset($tableDifferences->removedColumns[$removedColumnName]);
+ }
}
}
}

0 comments on commit 1947a85

Please sign in to comment.