Skip navigation
Help

db_add_index

6 database.mysql-common.inc db_add_index(&$ret, $table, $name, $fields)
6 database.pgsql.inc db_add_index(&$ret, $table, $name, $fields)
7 database.inc db_add_index($table, $name, $fields)

Adds an index.

Parameters

$table: The table to be altered.

$name: The name of the index.

$fields: An array of field names.

Related topics

30 calls to db_add_index()

File

drupal/includes/database/database.inc, line 2909
Core systems for the database layer.

Code

function db_add_index($table, $name, $fields) {
  return Database::getConnection()->schema()->addIndex($table, $name, $fields);
}