DatabaseSchema::addPrimaryKey
abstract public function DatabaseSchema::addPrimaryKey
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.
File
- includes/database/schema.inc, line 504
- Generic Database schema code.
Class
Code
abstract public function addPrimaryKey($table, $fields);
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!database!schema.inc/function/DatabaseSchema::addPrimaryKey/7.x