public function getDropIndexSQL($index, $table = null)
{
if ($index instanceof Index) {
$index = $index->getQuotedName($this);
} elseif (!is_string($index)) {
throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \\Doctrine\\DBAL\\Schema\\Index.');
}
if (!isset($table)) {
return 'DROP INDEX ' . $index;
}
if ($table instanceof Table) {
$table = $table->getQuotedName($this);
}
return "IF EXISTS (SELECT * FROM sysobjects WHERE name = '{$index}')\n ALTER TABLE " . $table . " DROP CONSTRAINT " . $index . "\n ELSE\n DROP INDEX " . $index . " ON " . $table;
}