You are here

function search_api_exclude_update_7101 in Search API exclude 7

Adapts the {search_api_exclude} table to only store excluded nodes.

File

./search_api_exclude.install, line 36
Install, update and uninstall functions for the Search API Exclude module.

Code

function search_api_exclude_update_7101() {
  db_delete('search_api_exclude')
    ->condition('node_exclude', 0)
    ->execute();
  db_drop_index('search_api_exclude', 'node_exclude');
  db_drop_field('search_api_exclude', 'node_exclude');
  $spec = array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
  );
  db_change_field('search_api_exclude', 'nid', 'nid', $spec);
  t('The update has been successfully executed. Please re-index content on all affected Search API indexes for the node exclusion to take effect.');
}