function faq_ask_schema in FAQ_Ask 7
Same name and namespace in other branches
- 8 faq_ask.install \faq_ask_schema()
- 6.2 faq_ask.install \faq_ask_schema()
- 6 faq_ask.install \faq_ask_schema()
Implements hook_schema().
File
- ./
faq_ask.install, line 12 - This module is an add-on to the FAQ module that allows users with the 'ask question' permission to create a question which will be queued for an 'expert' to answer.
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,
),
'tid' => array(
'description' => 'Taxonomy identifier of the terms for the expert.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
),
'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,
),
'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;
}