Fix generating migration test schemas

This commit is contained in:
Robin Appelman 2014-03-12 14:23:00 +01:00
parent 0035147be9
commit 58c61c8336
1 changed files with 4 additions and 1 deletions

View File

@ -88,11 +88,14 @@ class Migrator {
* @return \Doctrine\DBAL\Schema\Table
*/
protected function renameTableSchema(Table $table, $newName) {
/**
* @var \Doctrine\DBAL\Schema\Index[] $indexes
*/
$indexes = $table->getIndexes();
$newIndexes = array();
foreach ($indexes as $index) {
$indexName = uniqid(); // avoid conflicts in index names
$newIndexes[] = new Index($indexName, $index->getColumns(), $index->isUnique(), $index->isPrimary(), $index->getFlags());
$newIndexes[] = new Index($indexName, $index->getColumns(), $index->isUnique(), $index->isPrimary());
}
// foreign keys are not supported so we just set it to an empty array