You are here

function faq_schema in Frequently Asked Questions 8

Same name and namespace in other branches
  1. 6 faq.install \faq_schema()
  2. 7.2 faq.install \faq_schema()
  3. 7 faq.install \faq_schema()

Implements hook_schema().

File

./faq.install, line 13
FAQ module install file.

Code

function faq_schema() {
  $schema = array();
  $schema['faq_weights'] = array(
    'description' => 'A table containing the weight of each faq node by category.',
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The primary identifier for a term or category.  This will be 0 for non-categorized nodes.',
      ),
      'nid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The primary identifier for a node.',
      ),
      'weight' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'A number representing the weight of a node.  Nodes with lower weight values will appear above those with higher weight values.',
      ),
    ),
    'primary key' => array(
      'nid',
      'tid',
    ),
  );
  return $schema;
}