1 schema.inc abstract public DatabaseSchema::addPrimaryKey($table, $fields)

Add a primary key.

Parameters

string $table: The table to be altered.

string[] $fields: Fields for the primary key.

Return value

void:

Throws

DatabaseSchemaObjectDoesNotExistException If the specified table doesn't exist.

DatabaseSchemaObjectExistsException If the specified table already has a primary key.

File

core/includes/database/schema.inc, line 525
Generic Database schema code.

Class

DatabaseSchema
Base class for database schema definitions.

Code

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