abstract public function DatabaseSchema::addPrimaryKey in Drupal 7
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 includes/
database/ mysql/ schema.inc - Add a primary key.
- DatabaseSchema_pgsql::addPrimaryKey in includes/
database/ pgsql/ schema.inc - Add a primary key.
- DatabaseSchema_sqlite::addPrimaryKey in includes/
database/ sqlite/ schema.inc - Add a primary key.
File
- includes/
database/ schema.inc, line 575
Class
- DatabaseSchema
- Base class for database schema definitions.
Code
public abstract function addPrimaryKey($table, $fields);