You are here

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

Drops the current primary key and creates a new one. If the previous primary key was an internal primary key, it tries to cleant it up.

Parameters

mixed $table:

mixed $primary_key_sql:

File

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

Class

Schema

Namespace

Drupal\Driver\Database\sqlsrv

Code

protected function recreatePrimaryKey($table, $fields) {

  // Drop the existing primary key if exists, if it was a TPK
  // it will get completely dropped.
  $this
    ->cleanUpPrimaryKey($table);
  $this
    ->createPrimaryKey($table, $fields);
}