protected function Schema::recreatePrimaryKey in Drupal driver for SQL Server and SQL Azure 3.0.x
Same name and namespace in other branches
- 8.2 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::recreatePrimaryKey()
- 8 drivers/lib/Drupal/Driver/Database/sqlsrv/Schema.php \Drupal\Driver\Database\sqlsrv\Schema::recreatePrimaryKey()
Recreate primary key.
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
string $table: Table name.
mixed $fields: Array of fields.
File
- drivers/
lib/ Drupal/ Driver/ Database/ sqlsrv/ Schema.php, line 1264
Class
Namespace
Drupal\Driver\Database\sqlsrvCode
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);
}