abstract public function DatabaseSchema::addUniqueKey

Add a unique key.

Parameters

$table: The table to be altered.

$name: The name of the key.

$fields: An array of field names.

Throws

DatabaseSchemaObjectDoesNotExistException If the specified table doesn't exist.

DatabaseSchemaObjectExistsException If the specified table already has a key by that name.

3 methods override DatabaseSchema::addUniqueKey()
DatabaseSchema_mysql::addUniqueKey in drupal/includes/database/mysql/schema.inc
Add a unique key.
DatabaseSchema_pgsql::addUniqueKey in drupal/includes/database/pgsql/schema.inc
Add a unique key.
DatabaseSchema_sqlite::addUniqueKey in drupal/includes/database/sqlite/schema.inc
Add a unique key.

File

drupal/includes/database/schema.inc, line 536

Class

DatabaseSchema
Base class for database schema definitions.

Code

public abstract function addUniqueKey($table, $name, $fields);