You are here

function nodewords_schema in Nodewords: D6 Meta Tags 6.3

Same name and namespace in other branches
  1. 6 nodewords.install \nodewords_schema()
  2. 6.2 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',
        'unsigned' => TRUE,
        '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,
      ),
      'sid' => array(
        'description' => 'The secondary ID (i.e., the node revision 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,
      ),
      'language' => array(
        'description' => 'The language of this meta tag.',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'nodewords_lang' => array(
        array(
          'language',
          6,
        ),
      ),
      'nodewords_name' => array(
        array(
          'name',
          6,
        ),
      ),
      'nodewords_type_id' => array(
        'type',
        'id',
      ),
      'nodewords_sid' => array(
        'sid',
      ),
    ),
    'unique keys' => array(
      'nodewords_type_ids_name_lang' => array(
        'type',
        'id',
        'sid',
        'name',
        'language',
      ),
    ),
    'primary key' => array(
      'mtid',
    ),
  );
  $schema['nodewords_custom'] = array(
    'description' => 'The table containing data for custom pages.',
    'fields' => array(
      'pid' => array(
        'description' => 'The primary key.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The page name as shown in the list of custom pages.',
        'type' => 'varchar',
        'length' => 60,
        'not null' => TRUE,
        'default' => '',
      ),
      'path' => array(
        'description' => 'The page path.',
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
        'default' => '',
      ),
      'weight' => array(
        'description' => 'The weight of the page.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'enabled' => array(
        'description' => 'A flag set when the page is enabled.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 1,
      ),
    ),
    'primary key' => array(
      'pid',
    ),
  );
  return $schema;
}