You are here

function _taxonomy_edge_add_new_indexes in Taxonomy Edge 7

Add extra indexes to tables.

2 calls to _taxonomy_edge_add_new_indexes()
taxonomy_edge_install in ./taxonomy_edge.install
Implements hook_install().
taxonomy_edge_update_7102 in ./taxonomy_edge.install
Update and add indexes.

File

./taxonomy_edge.install, line 269
Installation file for Taxonomy Edge

Code

function _taxonomy_edge_add_new_indexes($force = FALSE) {
  $schema = array();
  taxonomy_edge_schema_alter($schema);
  foreach ($schema as $table => $table_def) {
    foreach ($table_def['indexes'] as $index_name => $fields) {
      if (!db_index_exists($table, $index_name)) {
        db_add_index($table, $index_name, $fields);
      }
      elseif ($force === TRUE || is_array($force) && in_array("{$table}:{$index_name}", $force)) {
        db_drop_index($table, $index_name);
        db_add_index($table, $index_name, $fields);
      }
    }
  }
}