public function DatabaseSchema_sqlsrv::dropUniqueKey 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::dropUniqueKey()
- 7 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::dropUniqueKey()
Override DatabaseSchema::dropUniqueKey().
Overrides DatabaseSchema::dropUniqueKey
1 call to DatabaseSchema_sqlsrv::dropUniqueKey()
- DatabaseSchema_sqlsrv::dropFieldRelatedObjects in sqlsrv/
schema.inc - Drop the related objects of a column (indexes, constraints, etc.).
File
- sqlsrv/
schema.inc, line 1627 - Database schema code for Microsoft SQL Server database servers.
Class
Code
public function dropUniqueKey($table, $name) {
if (!$this
->uniqueKeyExists($table, $name)) {
return FALSE;
}
$this->connection
->query_direct('DROP INDEX ' . $name . '_unique ON [{' . $table . '}]');
$this->connection
->query_direct('ALTER TABLE [{' . $table . '}] DROP COLUMN __unique_' . $name);
// Try to clean-up the technical primary key if possible.
$this
->cleanUpTechnicalPrimaryColumn($table);
return TRUE;
}