Commit 1947a85e authored by Lee Davis's avatar Lee Davis

fixed bug on schema comparitor, prevent multiple rename candidates for the same original field

parent 804bd86e
...@@ -282,10 +282,13 @@ class Comparator ...@@ -282,10 +282,13 @@ class Comparator
list($removedColumn, $addedColumn) = $candidateColumns[0]; list($removedColumn, $addedColumn) = $candidateColumns[0];
$removedColumnName = strtolower($removedColumn->getName()); $removedColumnName = strtolower($removedColumn->getName());
$addedColumnName = strtolower($addedColumn->getName()); $addedColumnName = strtolower($addedColumn->getName());
$tableDifferences->renamedColumns[$removedColumnName] = $addedColumn; if (!isset($tableDifferences->renamedColumns[$removedColumnName]))
unset($tableDifferences->addedColumns[$addedColumnName]); {
unset($tableDifferences->removedColumns[$removedColumnName]); $tableDifferences->renamedColumns[$removedColumnName] = $addedColumn;
unset($tableDifferences->addedColumns[$addedColumnName]);
unset($tableDifferences->removedColumns[$removedColumnName]);
}
} }
} }
} }
......
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