You are here

function search_api_page_schema in Search API Pages 7

Implements hook_schema().

File

./search_api_page.install, line 10
Install, update and uninstall functions for the Search pages module.

Code

function search_api_page_schema() {
  $schema['search_api_page'] = array(
    'description' => '',
    'fields' => array(
      'id' => array(
        'description' => 'The primary identifier for a search page.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'index_id' => array(
        'description' => 'The {search_api_index}.machine_name this page will search on.',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => 'The path at which this search page can be viewed.',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The displayed name for a search page.',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
      ),
      'machine_name' => array(
        'description' => 'The machine name for a search page.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'description' => array(
        'description' => 'The displayed description for a search page.',
        'type' => 'text',
        'not null' => FALSE,
      ),
      'options' => array(
        'description' => 'The options used to configure the search page.',
        'type' => 'text',
        'serialize' => TRUE,
        'not null' => TRUE,
      ),
      'enabled' => array(
        'description' => 'A flag indicating whether the search page is enabled.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 1,
      ),
      'status' => array(
        'description' => 'The exportable status of the entity.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0x1,
        'size' => 'tiny',
      ),
      'module' => array(
        'description' => 'The name of the providing module if the entity has been defined in code.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
    ),
    'indexes' => array(
      'enabled' => array(
        'enabled',
      ),
      'index_id' => array(
        'index_id',
      ),
    ),
    'unique' => array(
      'path' => array(
        'path',
      ),
      'machine_name' => array(
        'machine_name',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}