Commit 894493b2 authored by Benjamin Eberlei's avatar Benjamin Eberlei

[DBAL-586] Fix failures introduced by PR and adjust code.

parent 075c68b7
......@@ -642,15 +642,6 @@ class MySqlPlatform extends AbstractPlatform
}
}
}
foreach ($diff->changedIndexes as $changedKey => $changedIndex) {
if ($changedIndex->isPrimary() && $changedKey != 'PRIMARY') {
$index = $diff->changedIndexes[$changedKey];
$index = new Index($changedKey, $index->getColumns(), $index->isUnique(), false);
$diff->removedIndexes[$changedKey] = $index;
$diff->addedIndexes['PRIMARY'] = $diff->changedIndexes[$changedKey];
unset($diff->changedIndexes[$changedKey]);
}
}
$sql = array_merge($sql, parent::getPreAlterTableIndexForeignKeySQL($diff));
......
......@@ -314,7 +314,7 @@ class MySqlPlatformTest extends AbstractPlatformTestCase
$diffTable->setPrimaryKey(array('id'));
$this->assertEquals(
array('ALTER TABLE alter_table_add_pk DROP INDEX idx_id, ADD PRIMARY KEY (id)'),
array('DROP INDEX idx_id ON alter_table_add_pk', 'ALTER TABLE alter_table_add_pk ADD PRIMARY KEY (id)'),
$this->_platform->getAlterTableSQL($comparator->diffTable($table, $diffTable))
);
}
......@@ -375,7 +375,7 @@ class MySqlPlatformTest extends AbstractPlatformTestCase
$sql = $this->_platform->getAlterTableSQL($diff);
$this->assertEquals(array(
"DROP INDEX foo_index ON mytable",
"ALTER TABLE mytable DROP PRIMARY KEY",
"ALTER TABLE mytable ADD PRIMARY KEY (foo)",
), $sql);
}
......
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