Commit a5ae4016 authored by Juozas Kaziukenas's avatar Juozas Kaziukenas

Fixed getDropIndexSql() to handle all types of indexes

parent 2ea50ee7
...@@ -141,12 +141,11 @@ DROP DATABASE ' . $name . ';'; ...@@ -141,12 +141,11 @@ DROP DATABASE ' . $name . ';';
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getName();
} }
if (!isset($index_) || $index_->isPrimary() || $index_->isUnique()) { return "IF EXISTS (SELECT * FROM sysobjects WHERE name = '$index')
return 'ALTER TABLE ' . $table .' DROP CONSTRAINT ' . $index; ALTER TABLE " . $this->quoteIdentifier($table) . " DROP CONSTRAINT " . $this->quoteIdentifier($index) . "
} else { ELSE
return 'DROP INDEX ' . $index . ' ON ' . $table; DROP INDEX " . $this->quoteIdentifier($index) . " ON " . $this->quoteIdentifier($table);
}
} }
} }
......
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