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

Use getPrimaryKeyColumns api

parent 8f2a2a1f
......@@ -659,7 +659,8 @@ class MySqlPlatform extends AbstractPlatform
// Dropping primary keys requires to unset autoincrement attribute on the particular column first
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);
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