Commit a5ae4016 authored by Juozas Kaziukenas's avatar Juozas Kaziukenas

Fixed getDropIndexSql() to handle all types of indexes

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