db_add_primary_key

Versions
6
db_add_primary_key(&$ret, $table, $fields)
7
db_add_primary_key($table, $fields)

Add a primary key.

Parameters

$table The table to be altered.

$fields Fields for the primary key.

Related topics

▾ 2 functions call db_add_primary_key()

filter_update_7004 in modules/filter/filter.install
Move filter settings storage into {filter} table.
search_update_7000 in modules/search/search.install
Replace unique keys in 'search_dataset' and 'search_index' by primary keys.

Code

includes/database/database.inc, line 2451

<?php
function db_add_primary_key($table, $fields) {
  return Database::getConnection()->schema()->addPrimaryKey($table, $fields);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.