You are here

public function Schema::dropIndex in Drupal driver for SQL Server and SQL Azure 8.2

Same name and namespace in other branches
  1. 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::dropIndex()
  2. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::dropIndex()

Override DatabaseSchema::dropIndex().

@status tested

Overrides Schema::dropIndex

1 call to Schema::dropIndex()
Schema::cleanUpPrimaryKey in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Drop the primary key constraint.

File

drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php, line 1326
Definition of Drupal\Driver\Database\sqlsrv\Schema

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

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
    ->Scheme()
    ->IndexDrop($this->connection
    ->prefixTable($table), $name . '_idx');

  // If we just dropped an XML index, we can re-expand the original primary key index.
  if ($expand) {
    $this
      ->compressPrimaryKeyIndex($table);
  }
  $this
    ->getTableIntrospectionInvalidate($table);
  return true;
}