- public function dropIndex($tableName, $keyName, $schemaName = null)
- {
- $indexList = $this->getIndexList($tableName, $schemaName);
- $keyName = strtoupper($keyName);
- if (!isset($indexList[$keyName])) {
- return true;
- }
-
- if ($keyName == 'PRIMARY') {
- $cond = 'DROP PRIMARY KEY';
- } else {
- $cond = 'DROP KEY ' . $this->quoteIdentifier($indexList[$keyName]['KEY_NAME']);
- }
- $sql = sprintf(
- 'ALTER TABLE %s %s',
- $this->quoteIdentifier($this->_getTableName($tableName, $schemaName)),
- $cond
- );
-
- $this->resetDdlCache($tableName, $schemaName);
-
- return $this->rawQuery($sql);
- }