function db_index_exists in Drupal 7
Same name and namespace in other branches
- 8 core/includes/database.inc \db_index_exists()
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
9 calls to db_index_exists()
- aggregator_update_7004 in modules/
aggregator/ aggregator.install - Add index on timestamp.
- BasicMinimalUpdatePath::testBasicMinimalUpdate in modules/
simpletest/ tests/ upgrade/ upgrade.test - Tests a successful point release update.
- comment_update_7002 in modules/
comment/ comment.install - Rename {comments} table to {comment} and upgrade it.
- comment_update_7004 in modules/
comment/ comment.install - Upgrade the {node_comment_statistics} table.
- DatabaseRegressionTestCase::testDBIndexExists in modules/
simpletest/ tests/ database_test.test - Test the db_index_exists() function.
File
- includes/
database/ database.inc, line 2857 - Core systems for the database layer.
Code
function db_index_exists($table, $name) {
return Database::getConnection()
->schema()
->indexExists($table, $name);
}