You are here

function search_api_grouping_update_7001 in Search API Grouping 7.2

Ensure table indexes are set.

File

./search_api_grouping.install, line 102
Installation and update hooks for search_api_denormalized_entity.

Code

function search_api_grouping_update_7001() {
  $schema = search_api_grouping_schema();
  $update_indexes = array(
    'entity_type',
    'entity_type_2',
    'entity_type_3',
  );
  foreach ($update_indexes as $index) {
    if (isset($schema['search_api_denormalized_entity']['indexes'][$index]) && !db_index_exists('search_api_denormalized_entity', $index)) {
      db_add_index('search_api_denormalized_entity', $index, $schema['search_api_denormalized_entity']['indexes'][$index]);
    }
  }
}