You are here

protected function DatabaseSchema_sqlsrv::recreatePrimaryKey in Drupal driver for SQL Server and SQL Azure 7.2

Same name and namespace in other branches
  1. 7.3 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::recreatePrimaryKey()
  2. 7 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::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

sqlsrv/schema.inc, line 574
Database schema code for Microsoft SQL Server database servers.

Class

DatabaseSchema_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);
}