1 database.inc db_index_exists($table, $name)

Checks if an index exists in the given table.

Parameters

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

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

Return value

TRUE if the given index exists, otherwise FALSE.

Related topics

File

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

Code

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