You are here

public function DatabaseSchemaInterface::addPrimaryKey in Schema 8

Add a primary key.

Parameters

$table: The table to be altered.

$fields: Fields for the primary key.

Throws

\Drupal\Core\Database\SchemaObjectDoesNotExistException If the specified table doesn't exist.

\Drupal\Core\Database\SchemaObjectExistsException If the specified table already has a primary key.

File

src/DatabaseSchemaInterface.php, line 185
Contains Drupal\schema\DatabaseSchemaInterface.

Class

DatabaseSchemaInterface
This interface describes public methods of \Drupal\Core\Database\Schema.

Namespace

Drupal\schema

Code

public function addPrimaryKey($table, $fields);