You are here

function search_log_schema in Search Log 6

Same name and namespace in other branches
  1. 8 search_log.install \search_log_schema()
  2. 7 search_log.install \search_log_schema()

Implementation of hook_schema().

File

./search_log.install, line 11
Install file for Search log.

Code

function search_log_schema() {
  $schema['search_log'] = array(
    'description' => t('Log of search terms.'),
    'fields' => array(
      'qid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Auto-incrementing query ID.',
      ),
      'q' => array(
        'description' => t('Search term.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'module' => array(
        'description' => t('Module implementing search.'),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
        'default' => '',
      ),
      'day' => array(
        'description' => t('Day search was performed.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'counter' => array(
        'description' => t('Number of times search performed on day.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'size' => 'medium',
      ),
      'result' => array(
        'description' => t('Indicator of failed or successful searches.'),
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'qid',
    ),
    'unique keys' => array(
      'qmd' => array(
        'q',
        'module',
        'day',
      ),
    ),
  );
  return $schema;
}