You are here

function search_config_update_7001 in Search configuration 7

Creates entity search exclusion table.

File

./search_config.install, line 119
Install, update and uninstall functions for the Search Configuration module.

Code

function search_config_update_7001() {
  if (!db_table_exists('search_config_exclude')) {
    $schema = array(
      'description' => 'Provides a way to exclude specific entities from the search results. Note that this does not stop the entities from being indexed.',
      'fields' => array(
        'entity_id' => array(
          'description' => 'The {node}.nid to exclude.',
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
          'default' => 0,
        ),
        'entity_type' => array(
          'description' => 'The entity type to exclude.',
          'type' => 'varchar',
          'length' => 128,
          'not null' => TRUE,
          'default' => '',
        ),
        'exclude' => array(
          'description' => 'Exclusion flag. Default 1: exclude from public searches.',
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
          'default' => 1,
          'size' => 'tiny',
        ),
      ),
      'primary key' => array(
        'entity_id',
        'entity_type',
      ),
    );
    db_create_table('search_config_exclude', $schema);
  }
}