You are here

function xmlsitemap_schema in XML sitemap 6

Same name and namespace in other branches
  1. 8 xmlsitemap.install \xmlsitemap_schema()
  2. 6.2 xmlsitemap.install \xmlsitemap_schema()
  3. 7.2 xmlsitemap.install \xmlsitemap_schema()
  4. 2.x xmlsitemap.install \xmlsitemap_schema()

Implementation of hook_schema().

File

./xmlsitemap.install, line 30
Installation file for XML sitemap.

Code

function xmlsitemap_schema() {
  $schema['xmlsitemap'] = array(
    'description' => 'The base table for xmlsitemap.',
    'fields' => array(
      'lid' => array(
        'description' => 'The primary key.',
        'type' => 'serial',
        'not null' => TRUE,
      ),
      'loc' => array(
        'description' => 'The relative URL.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'module' => array(
        'description' => 'The module handling this link.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'type' => array(
        'description' => 'The type of link.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'id' => array(
        'description' => 'The ID associated with the link.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'sid' => array(
        'description' => 'The sub ID associated with the link.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'language' => array(
        'description' => 'The language associated with the link.',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
      'changed' => array(
        'description' => 'The Unix timestamp of the last change.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'changefreq' => array(
        'description' => 'The frequency of the changes.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'priority' => array(
        'description' => 'The priority of this node in the sitemap.',
        'type' => 'float',
        'not null' => TRUE,
        'default' => 0.5,
      ),
    ),
    'indexes' => array(
      'link_module' => array(
        array(
          'module',
          25,
        ),
      ),
      'link_language' => array(
        'language',
      ),
      'link_changed' => array(
        'changed',
      ),
      'link_priority' => array(
        'priority',
      ),
      'type_id' => array(
        'type',
        'id',
      ),
      'loc' => array(
        'loc',
      ),
    ),
    'primary key' => array(
      'lid',
    ),
  );
  return $schema;
}