You are here

public function Schema::dropPrimaryKey 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::dropPrimaryKey()
  2. 3.0.x drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::dropPrimaryKey()

Override DatabaseSchema::dropPrimaryKey().

@status tested

Overrides Schema::dropPrimaryKey

File

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

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

public function dropPrimaryKey($table) {
  if (!$this
    ->primaryKeyName($table)) {
    return FALSE;
  }
  $this
    ->cleanUpPrimaryKey($table);
  $this
    ->createTechnicalPrimaryColumn($table);
  $this->connection
    ->query("ALTER TABLE [{{$table}}] ADD CONSTRAINT {{$table}}_pkey_technical PRIMARY KEY CLUSTERED ({$this->TECHNICAL_PK_COLUMN_NAME})");
  return TRUE;
}