abstract public function DatabaseSchema::addPrimaryKey

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()

File

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

Class

DatabaseSchema
Base class for database schema definitions.

Code

public abstract function addPrimaryKey($table, $fields);