1
0
mirror of synced 2025-01-19 06:51:40 +03:00

Merge pull request #261 from armetiz/patch-7

Unique key name isn't correctly set - DDC-1603
This commit is contained in:
Guilherme Blanco 2012-01-16 19:44:22 -08:00
commit 2bb511584e

View File

@ -223,13 +223,13 @@ class SchemaTool
if (isset($class->table['indexes'])) { if (isset($class->table['indexes'])) {
foreach ($class->table['indexes'] AS $indexName => $indexData) { foreach ($class->table['indexes'] AS $indexName => $indexData) {
$table->addIndex($indexData['columns'], $indexName); $table->addIndex($indexData['columns'], is_numeric($indexName) ? null : $indexName);
} }
} }
if (isset($class->table['uniqueConstraints'])) { if (isset($class->table['uniqueConstraints'])) {
foreach ($class->table['uniqueConstraints'] AS $indexName => $indexData) { foreach ($class->table['uniqueConstraints'] AS $indexName => $indexData) {
$table->addUniqueIndex($indexData['columns'], $indexName); $table->addUniqueIndex($indexData['columns'], is_numeric($indexName) ? null : $indexName);
} }
} }