You are here

function apachesolr_search_update_7002 in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr_search.install \apachesolr_search_update_7002()

Add apachesolr_search_page table for real.

File

./apachesolr_search.install, line 201
Install and related hooks for apachesolr_search.

Code

function apachesolr_search_update_7002() {
  $schema['apachesolr_search_page'] = array(
    'description' => 'Apache Solr Search search page settings.',
    'export' => array(
      'key' => 'page_id',
      'identifier' => 'searcher',
      'default hook' => 'apachesolr_search_default_searchers',
      'status' => 'apachesolr_search_page_status',
      'api' => array(
        'owner' => 'apachesolr_search',
        'api' => 'apachesolr_search_defaults',
        'minimum_version' => 3,
        'current_version' => 3,
      ),
    ),
    'fields' => array(
      'page_id' => array(
        'description' => 'The machine readable name of the search page.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'description' => 'The human readable name of the search page.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'description' => array(
        'description' => 'The description of the search page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'search_path' => array(
        'description' => 'The path to the search page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'page_title' => array(
        'description' => 'The title of the search page.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'env_id' => array(
        'description' => 'The machine name of the search environment.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'description' => 'Serialized storage of general settings.',
        'type' => 'text',
        'serialize' => TRUE,
      ),
    ),
    'primary key' => array(
      'page_id',
    ),
    'indexes' => array(
      'env_id' => array(
        'env_id',
      ),
    ),
  );
  if (db_table_exists('apachesolr_search_page')) {

    // Just in case you are chasing HEAD.
    db_drop_table('apachesolr_search_page');
  }
  db_create_table('apachesolr_search_page', $schema['apachesolr_search_page']);
}