You are here

public function Schema::dropUniqueKey in Drupal driver for SQL Server and SQL Azure 8

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

Override DatabaseSchema::dropUniqueKey().

Overrides Schema::dropUniqueKey

1 call to Schema::dropUniqueKey()
Schema::dropFieldRelatedObjects in drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php
Drop the related objects of a column (indexes, constraints, etc.).

File

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

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function dropUniqueKey($table, $name) {
  if (!$this
    ->uniqueKeyExists($table, $name)) {
    return FALSE;
  }
  $this->connection
    ->query('DROP INDEX ' . $name . '_unique ON [{' . $table . '}]');
  $this->connection
    ->query('ALTER TABLE [{' . $table . '}] DROP COLUMN __unique_' . $name);

  // Try to clean-up the technical primary key if possible.
  $this
    ->cleanUpTechnicalPrimaryColumn($table);
  return TRUE;
}