You are here

function nodewords_schema in Nodewords: D6 Meta Tags 6

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

Implements hook_schema().

2 calls to nodewords_schema()
nodewords_update_6175 in ./nodewords.install
Make the custom tags 'name' field larger.
nodewords_update_6181 in ./nodewords.install
In 6.x-1.12-x the custom-path functionality was managed by a submodule, so it is possible for sites to be updated and not have the table.

File

./nodewords.install, line 50
Installation file for 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' => 128,
        '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',
    ),
  );
  $schema['nodewords_custom'] = array(
    'description' => 'The table containing data for custom pages.',
    'fields' => array(
      'pid' => array(
        'description' => 'The primary key.',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The page name as shown in the list of custom pages.',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'path' => array(
        'description' => 'The page path.',
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
      ),
      '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',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 1,
      ),
    ),
    'primary key' => array(
      'pid',
    ),
  );
  return $schema;
}