You are here

function apachesolr_user_schema in Apachesolr User 7

Same name and namespace in other branches
  1. 6 apachesolr_user.install \apachesolr_user_schema()

Implements hook_schema().

File

./apachesolr_user.install, line 12
Install and related hooks for apachesolr_indexer_user.

Code

function apachesolr_user_schema() {
  $types = array(
    'user' => 'apachesolr_index_entities_user',
  );
  foreach ($types as $type) {
    $schema[$type] = array(
      'description' => t('Stores a record of when an entity changed to determine if it needs indexing by Solr.'),
      'fields' => array(
        'entity_type' => array(
          'description' => t('The type of entity.'),
          'type' => 'varchar',
          'length' => 128,
          'not null' => TRUE,
        ),
        'entity_id' => array(
          'description' => t('The primary identifier for an entity.'),
          'type' => 'int',
          'unsigned' => TRUE,
          'not null' => TRUE,
        ),
        'bundle' => array(
          'description' => t('The bundle to which this entity belongs.'),
          'type' => 'varchar',
          'length' => 128,
          'not null' => TRUE,
        ),
        'status' => array(
          'description' => t('Boolean indicating whether the entity is visible to non-administrators (eg, published for nodes).'),
          'type' => 'int',
          'not null' => TRUE,
          'default' => 1,
        ),
        'changed' => array(
          'description' => t('The Unix timestamp when an entity was changed.'),
          'type' => 'int',
          'not null' => TRUE,
          'default' => 0,
        ),
      ),
      'indexes' => array(
        'changed' => array(
          'changed',
          'status',
        ),
      ),
      'primary key' => array(
        'entity_id',
      ),
    );
  }
  return $schema;
}