You are here

function nodewords_schema in Nodewords: D6 Meta Tags 6.2

Same name and namespace in other branches
  1. 6.3 nodewords.install \nodewords_schema()
  2. 6 nodewords.install \nodewords_schema()

Implements hook_schema().

File

./nodewords.install, line 43
Install, update and uninstall functions for the Nodewords module.

Code

function nodewords_schema() {
  $schema = array();
  $schema['nodewords'] = array(
    'description' => 'The table containing the meta tag values for all the pages.',
    'fields' => array(
      'mtid' => array(
        'description' => 'The primary key.',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The type of object to which the meta tag refers (node, user, page, etc...).',
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'id' => array(
        'description' => 'The object ID.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'name' => array(
        'description' => 'The meta tag name.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'content' => array(
        'description' => 'The content of the meta tag.',
        'type' => 'text',
        'size' => 'big',
        'not null' => TRUE,
      ),
    ),
    'indexes' => array(
      'nodewords_name' => array(
        array(
          'name',
          6,
        ),
      ),
      'nodewords_type_id' => array(
        'type',
        'id',
      ),
    ),
    'unique keys' => array(
      'nodewords_type_id_name' => array(
        'type',
        'id',
        'name',
      ),
    ),
    'primary key' => array(
      'mtid',
    ),
  );
  return $schema;
}