function db_add_index

Adds an index.

Parameters

$table: The table to be altered.

$name: The name of the index.

$fields: An array of field names.

Related topics

4 calls to db_add_index()
comment_update_8000 in drupal/core/modules/comment/comment.install
Renames {comment}.language to {comment}.langcode.
field_sql_storage_field_storage_update_field in drupal/core/modules/field/modules/field_sql_storage/field_sql_storage.module
Implements hook_field_storage_update_field().
field_sql_storage_update_8000 in drupal/core/modules/field/modules/field_sql_storage/field_sql_storage.install
Changes field language into langcode.
SchemaTest::testSchema in drupal/core/modules/system/lib/Drupal/system/Tests/Common/SchemaTest.php
Tests database interactions.

File

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

Code

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