abstract public function DatabaseSchema::addPrimaryKey
7.x schema.inc | abstract public DatabaseSchema::addPrimaryKey($table, $fields) |
Add a primary key.
Parameters
$table: The table to be altered.
$fields: Fields for the primary key.
Throws
DatabaseSchemaObjectDoesNotExistException If the specified table doesn't exist.
DatabaseSchemaObjectExistsException If the specified table already has a primary key.
3 methods override DatabaseSchema::addPrimaryKey()
- DatabaseSchema_mysql::addPrimaryKey in drupal-7.x/
includes/ database/ mysql/ schema.inc - Add a primary key.
- DatabaseSchema_pgsql::addPrimaryKey in drupal-7.x/
includes/ database/ pgsql/ schema.inc - Add a primary key.
- DatabaseSchema_sqlite::addPrimaryKey in drupal-7.x/
includes/ database/ sqlite/ schema.inc - Add a primary key.
File
- drupal-7.x/
includes/ database/ schema.inc, line 501 - Generic Database schema code.
Class
Code
abstract public function addPrimaryKey($table, $fields);