public function DatabaseSchema_sqlsrv::dropPrimaryKey in Drupal driver for SQL Server and SQL Azure 7.2
Same name and namespace in other branches
- 7.3 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::dropPrimaryKey()
- 7 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::dropPrimaryKey()
Override DatabaseSchema::dropPrimaryKey().
@status tested
Overrides DatabaseSchema::dropPrimaryKey
File
- sqlsrv/
schema.inc, line 1514 - Database schema code for Microsoft SQL Server database servers.
Class
Code
public function dropPrimaryKey($table) {
if (!$this
->primaryKeyName($table)) {
return FALSE;
}
$this
->cleanUpPrimaryKey($table);
$this
->createTechnicalPrimaryColumn($table);
$this->connection
->query_direct("ALTER TABLE [{{$table}}] ADD CONSTRAINT {{$table}}_pkey_technical PRIMARY KEY CLUSTERED ({$this->TECHNICAL_PK_COLUMN_NAME})");
return TRUE;
}