@@ 433-456 (lines=24) @@ | ||
430 | /** |
|
431 | * {@inheritDoc} |
|
432 | */ |
|
433 | public function getDropIndexSQL($index, $table=null) |
|
434 | { |
|
435 | if ($index instanceof Index) { |
|
436 | $indexName = $index->getQuotedName($this); |
|
437 | } elseif (is_string($index)) { |
|
438 | $indexName = $index; |
|
439 | } else { |
|
440 | throw new \InvalidArgumentException('DrizzlePlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); |
|
441 | } |
|
442 | ||
443 | if ($table instanceof Table) { |
|
444 | $table = $table->getQuotedName($this); |
|
445 | } elseif (!is_string($table)) { |
|
446 | throw new \InvalidArgumentException('DrizzlePlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); |
|
447 | } |
|
448 | ||
449 | if ($index instanceof Index && $index->isPrimary()) { |
|
450 | // drizzle primary keys are always named "PRIMARY", |
|
451 | // so we cannot use them in statements because of them being keyword. |
|
452 | return $this->getDropPrimaryKeySQL($table); |
|
453 | } |
|
454 | ||
455 | return 'DROP INDEX ' . $indexName . ' ON ' . $table; |
|
456 | } |
|
457 | ||
458 | /** |
|
459 | * {@inheritDoc} |
@@ 965-988 (lines=24) @@ | ||
962 | /** |
|
963 | * {@inheritDoc} |
|
964 | */ |
|
965 | public function getDropIndexSQL($index, $table=null) |
|
966 | { |
|
967 | if ($index instanceof Index) { |
|
968 | $indexName = $index->getQuotedName($this); |
|
969 | } elseif (is_string($index)) { |
|
970 | $indexName = $index; |
|
971 | } else { |
|
972 | throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); |
|
973 | } |
|
974 | ||
975 | if ($table instanceof Table) { |
|
976 | $table = $table->getQuotedName($this); |
|
977 | } elseif (!is_string($table)) { |
|
978 | throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); |
|
979 | } |
|
980 | ||
981 | if ($index instanceof Index && $index->isPrimary()) { |
|
982 | // mysql primary keys are always named "PRIMARY", |
|
983 | // so we cannot use them in statements because of them being keyword. |
|
984 | return $this->getDropPrimaryKeySQL($table); |
|
985 | } |
|
986 | ||
987 | return 'DROP INDEX ' . $indexName . ' ON ' . $table; |
|
988 | } |
|
989 | ||
990 | /** |
|
991 | * @param string $table |