public function Schema::dropIndex in Drupal driver for SQL Server and SQL Azure 4.2.x
Same name and namespace in other branches
- 3.1.x src/Driver/Database/sqlsrv/Schema.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Schema::dropIndex()
- 4.0.x src/Driver/Database/sqlsrv/Schema.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Schema::dropIndex()
- 4.1.x src/Driver/Database/sqlsrv/Schema.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Schema::dropIndex()
Drop an index.
Parameters
$table: The table to be altered.
$name: The name of the index.
Return value
TRUE if the index was successfully dropped, FALSE if there was no index by that name to begin with.
Overrides Schema::dropIndex
1 call to Schema::dropIndex()
- Schema::cleanUpPrimaryKey in src/
Driver/ Database/ sqlsrv/ Schema.php - Drop the primary key constraint.
File
- src/
Driver/ Database/ sqlsrv/ Schema.php, line 524
Class
Namespace
Drupal\sqlsrv\Driver\Database\sqlsrvCode
public function dropIndex($table, $name) {
if (!$this
->indexExists($table, $name)) {
return FALSE;
}
$expand = FALSE;
if (($index = $this
->tableHasXmlIndex($table)) && $index == $name . '_idx') {
$expand = TRUE;
}
$this->connection
->query('DROP INDEX ' . $name . '_idx ON {' . $table . '}');
$this
->resetColumnInformation($table);
// If we just dropped an XML index, we can re-expand the original primary
// key index.
if ($expand) {
$this
->compressPrimaryKeyIndex($table);
}
return TRUE;
}