function db_index_exists

7.x database.inc db_index_exists($table, $name)

Checks if an index exists in the given table.

Parameters

$table: The name of the table in drupal (no prefixing).

$name: The name of the index in drupal (no prefixing).

Return value

TRUE if the given index exists, otherwise FALSE.

Related topics

5 calls to db_index_exists()
comment_update_7002 in drupal-7.x/modules/comment/comment.install
Rename {comments} table to {comment} and upgrade it.
comment_update_7004 in drupal-7.x/modules/comment/comment.install
Upgrade the {node_comment_statistics} table.
DatabaseRegressionTestCase::testDBIndexExists in drupal-7.x/modules/simpletest/tests/database_test.test
Test the db_index_exists() function.
locale_update_7000 in drupal-7.x/modules/locale/locale.install
Add context field index and allow longer location.
user_update_7018 in drupal-7.x/modules/user/user.install
Ensure there is an index on {users}.picture.

File

drupal-7.x/includes/database/database.inc, line 2748
Core systems for the database layer.

Code

function db_index_exists($table, $name) {
  return Database::getConnection()->schema()->indexExists($table, $name);
}