db_add_unique_key

Definition

db_add_unique_key(&$ret, $table, $name, $fields)
drupal/includes/database/database.inc, line 2130

Description

Add a unique key.

Parameters

$ret Array to which query results will be added.

$table The table to be altered.

$name The name of the key.

$fields An array of field names.

Related topics

Namesort iconDescription
Schema APIA Drupal schema definition is an array structure representing one or more tables and their related keys and indexes. A schema is defined by hook_schema(), which usually lives in a modulename.install file.

Code

function db_add_unique_key(&$ret, $table, $name, $fields) {
  return Database::getActiveConnection()->schema()->addUniqueKey($ret, $table, $name, $fields);
}