You are here

apachesolr_user.install in Apachesolr User 6

Same filename and directory in other branches
  1. 7 apachesolr_user.install

File

apachesolr_user.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function apachesolr_user_install() {

  // Create tables.
  drupal_install_schema('apachesolr_user');
  drupal_set_message(t('Apache Solr User Search is enabled.'));
}

/**
 * Implementation of hook_enable().
 */
function apachesolr_user_enable() {

  // Completely build the index table.
  apachesolr_user_rebuild_index_table();
}

/**
 * Implementation of hook_schema().
 */
function apachesolr_user_schema() {
  $schema['apachesolr_search_user'] = array(
    'description' => t('Stores a record of when a user property changed to determine if it needs indexing by Solr.'),
    'fields' => array(
      'uid' => array(
        'description' => t('The primary identifier for a user.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'status' => array(
        'description' => t('Boolean indicating whether the user is visible to non-administrators.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 1,
      ),
      'changed' => array(
        'description' => t('The Unix timestamp when a user property was changed.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'changed' => array(
        'changed',
        'status',
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_uninstall()
 */
function apachesolr_user_uninstall() {

  // Remove tables.
  drupal_uninstall_schema('apachesolr_user');
}

Functions

Namesort descending Description
apachesolr_user_enable Implementation of hook_enable().
apachesolr_user_install Implementation of hook_install().
apachesolr_user_schema Implementation of hook_schema().
apachesolr_user_uninstall Implementation of hook_uninstall()