You are here

function faq_ask_schema in FAQ_Ask 8

Same name and namespace in other branches
  1. 6.2 faq_ask.install \faq_ask_schema()
  2. 6 faq_ask.install \faq_ask_schema()
  3. 7 faq_ask.install \faq_ask_schema()

Implements hook_schema().

File

./faq_ask.install, line 13
This module is an add-on to FAQ module, allows users to 'ask question'.

Code

function faq_ask_schema() {
  $schema['faq_expert'] = array(
    'description' => 'FAQ expert to term mapping.',
    'fields' => array(
      'uid' => array(
        'description' => 'User identifier for the expert.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'tid' => array(
        'description' => 'Taxonomy identifier of the terms for the expert.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'uid',
      'tid',
    ),
    'indexes' => array(
      'tid' => array(
        'tid',
        'uid',
      ),
    ),
  );
  $schema['faq_ask_notify'] = array(
    'description' => 'FAQ node to asker mapping.',
    'fields' => array(
      'nid' => array(
        'description' => 'Node identifier for notification',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'email' => array(
        'description' => 'Node identifier for notification',
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'nid',
      'email',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
        'email',
      ),
    ),
  );
  $schema['faq_ask_term_index'] = array(
    'description' => 'FAQ-Ask maintained index of unpublished node/term relationships.',
    'fields' => array(
      'nid' => array(
        'description' => 'The {node}.nid this record tracks.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'tid' => array(
        'description' => 'The term ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'sticky' => array(
        'description' => 'Boolean indicating whether the node is sticky.',
        'type' => 'int',
        'not null' => FALSE,
        'default' => 0,
        'size' => 'tiny',
      ),
      'created' => array(
        'description' => 'The Unix timestamp when the node was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(
      'term_node' => array(
        'tid',
        'sticky',
        'created',
      ),
      'nid' => array(
        'nid',
      ),
    ),
    'foreign keys' => array(
      'tracked_node' => array(
        'table' => 'node',
        'columns' => array(
          'nid' => 'nid',
        ),
      ),
      'term' => array(
        'table' => 'taxonomy_term_data',
        'columns' => array(
          'tid' => 'tid',
        ),
      ),
    ),
  );
  return $schema;
}