function xmlsitemap_schema in XML sitemap 7.2
Same name and namespace in other branches
- 8 xmlsitemap.install \xmlsitemap_schema()
- 6.2 xmlsitemap.install \xmlsitemap_schema()
- 6 xmlsitemap.install \xmlsitemap_schema()
- 2.x xmlsitemap.install \xmlsitemap_schema()
Implements hook_schema().
File
- ./
xmlsitemap.install, line 151 - Install, update and uninstall functions for the xmlsitemap module.
Code
function xmlsitemap_schema() {
// @todo Rename to xmlsitemap_link
$schema['xmlsitemap'] = array(
'description' => 'The base table for xmlsitemap links.',
'fields' => array(
'id' => array(
'description' => 'Primary key with type; a unique id for the item.',
'type' => 'int',
'not null' => TRUE,
'unsigned' => TRUE,
'default' => 0,
),
'type' => array(
'description' => 'Primary key with id; the type of item (e.g. node, user, etc.).',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
),
'subtype' => array(
'description' => 'A sub-type identifier for the link (node type, menu name, term VID, etc.).',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
),
'loc' => array(
'description' => 'The URL to the item relative to the Drupal path.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
'language' => array(
'description' => 'The {languages}.language of this link or an empty string if it is language-neutral.',
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => '',
),
'access' => array(
'description' => 'A boolean that represents if the item is viewable by the anonymous user. This field is useful to store the result of node_access() so we can retain changefreq and priority_override information.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'status' => array(
'description' => 'An integer that represents if the item is included in the sitemap.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 1,
),
'status_override' => array(
'description' => 'A boolean that if TRUE means that the status field has been overridden from its default value.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'lastmod' => array(
'description' => 'The UNIX timestamp of last modification of the item.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'priority' => array(
'description' => 'The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0.',
'type' => 'float',
'default' => NULL,
),
'priority_override' => array(
'description' => 'A boolean that if TRUE means that the priority field has been overridden from its default value.',
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
),
'changefreq' => array(
'description' => 'The average time in seconds between changes of this item.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'changecount' => array(
'description' => 'The number of times this item has been changed. Used to help calculate the next changefreq value.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'id',
'type',
),
'indexes' => array(
'loc' => array(
'loc',
),
'access_status_loc' => array(
'access',
'status',
'loc',
),
'type_subtype' => array(
'type',
'subtype',
),
'language' => array(
'language',
),
),
);
$schema['xmlsitemap_sitemap'] = array(
'fields' => array(
'smid' => array(
'description' => 'The sitemap ID (the hashed value of {xmlsitemap}.context.',
'type' => 'varchar',
'length' => 64,
'not null' => TRUE,
),
'context' => array(
'description' => 'Serialized array with the sitemaps context',
'type' => 'text',
'not null' => TRUE,
'serialize' => TRUE,
),
'updated' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'links' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'chunks' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'max_filesize' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
'primary key' => array(
'smid',
),
);
return $schema;
}