Commit 6e88f08a authored by andig's avatar andig Committed by Steve Müller

Use getPrimaryKeyColumns api

parent 2010be24
...@@ -648,7 +648,8 @@ class MySqlPlatform extends AbstractPlatform ...@@ -648,7 +648,8 @@ class MySqlPlatform extends AbstractPlatform
// Dropping primary keys requires to unset autoincrement attribute on the particular column first // Dropping primary keys requires to unset autoincrement attribute on the particular column first
if ($chgIndex->isPrimary() && $diff->fromTable instanceof Table) { if ($chgIndex->isPrimary() && $diff->fromTable instanceof Table) {
foreach ($diff->fromTable->getIndex($chgIndex->getName())->getColumns() as $columnName) { // when chgIndex->isPrimary we can be sure fromTable->hasPrimaryKey is true
foreach ($diff->fromTable->getPrimaryKeyColumns() as $columnName) {
$column = $diff->fromTable->getColumn($columnName); $column = $diff->fromTable->getColumn($columnName);
if ($column->getAutoincrement() === true && in_array($columnName, $chgIndex->getColumns()) === false) { if ($column->getAutoincrement() === true && in_array($columnName, $chgIndex->getColumns()) === false) {
......
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