You are here

function search_api_schema in Search API 8

Same name and namespace in other branches
  1. 7 search_api.install \search_api_schema()

Implements hook_schema().

File

./search_api.install, line 18
Install, update and uninstall functions for the Search API module.

Code

function search_api_schema() {
  $schema['search_api_item'] = [
    'description' => 'Stores the items which should be indexed for each index, and their state.',
    'fields' => [
      'index_id' => [
        'description' => 'The ID of the index this item belongs to',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
      ],
      'datasource' => [
        'description' => 'The plugin ID of the datasource this item belongs to',
        'type' => 'varchar',
        'length' => 50,
        'not null' => TRUE,
      ],
      'item_id' => [
        'description' => 'The unique identifier of this item',
        'type' => 'varchar',
        'length' => 150,
        'not null' => TRUE,
      ],
      'changed' => [
        'description' => 'A timestamp indicating when the item was last changed',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ],
      'status' => [
        'description' => 'Boolean indicating the reindexation status, "1" when we need to reindex, "0" otherwise',
        'type' => 'int',
        'not null' => TRUE,
      ],
    ],
    'indexes' => [
      'indexing' => [
        'index_id',
        'status',
        'changed',
        'item_id',
      ],
    ],
    'primary key' => [
      'index_id',
      'item_id',
    ],
  ];
  return $schema;
}