diff --git a/lib/Doctrine/DBAL/Schema/Table.php b/lib/Doctrine/DBAL/Schema/Table.php index eb54b07db..fd2a8219b 100644 --- a/lib/Doctrine/DBAL/Schema/Table.php +++ b/lib/Doctrine/DBAL/Schema/Table.php @@ -179,7 +179,11 @@ class Table extends AbstractAsset throw SchemaException::indexNameInvalid($indexName); } - foreach ($columnNames AS $columnName) { + foreach ($columnNames AS $columnName => $indexColOptions) { + if (is_numeric($columnName) && is_string($indexColOptions)) { + $columnName = $indexColOptions; + } + if (!isset($this->_columns[$columnName])) { throw SchemaException::columnDoesNotExist($columnName); }