- Patch #214271 by recidive: improved schema identation.

merge-requests/26/head
Dries Buytaert 2008-03-15 12:31:29 +00:00
parent 637ec9359c
commit f5d4287cd5
12 changed files with 424 additions and 252 deletions

View File

@ -56,7 +56,9 @@ function aggregator_schema() {
) )
), ),
'primary key' => array('cid'), 'primary key' => array('cid'),
'unique keys' => array('title' => array('title')), 'unique keys' => array(
'title' => array('title'),
),
); );
$schema['aggregator_category_feed'] = array( $schema['aggregator_category_feed'] = array(
@ -76,7 +78,9 @@ function aggregator_schema() {
) )
), ),
'primary key' => array('cid', 'fid'), 'primary key' => array('cid', 'fid'),
'indexes' => array('fid' => array('fid')), 'indexes' => array(
'fid' => array('fid'),
),
); );
$schema['aggregator_category_item'] = array( $schema['aggregator_category_item'] = array(
@ -96,7 +100,9 @@ function aggregator_schema() {
) )
), ),
'primary key' => array('cid', 'iid'), 'primary key' => array('cid', 'iid'),
'indexes' => array('iid' => array('iid')), 'indexes' => array(
'iid' => array('iid'),
),
); );
$schema['aggregator_feed'] = array( $schema['aggregator_feed'] = array(
@ -234,7 +240,9 @@ function aggregator_schema() {
) )
), ),
'primary key' => array('iid'), 'primary key' => array('iid'),
'indexes' => array('fid' => array('fid')), 'indexes' => array(
'fid' => array('fid'),
),
); );
return $schema; return $schema;

View File

@ -114,7 +114,7 @@ function block_schema() {
'not null' => TRUE, 'not null' => TRUE,
'description' => t("The block's origin module, from {blocks}.module."), 'description' => t("The block's origin module, from {blocks}.module."),
), ),
'delta' => array( 'delta' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 32,
'not null' => TRUE, 'not null' => TRUE,
@ -127,11 +127,7 @@ function block_schema() {
'description' => t("The user's role ID from {users_roles}.rid."), 'description' => t("The user's role ID from {users_roles}.rid."),
), ),
), ),
'primary key' => array( 'primary key' => array('module', 'delta', 'rid'),
'module',
'delta',
'rid'
),
'indexes' => array( 'indexes' => array(
'rid' => array('rid'), 'rid' => array('rid'),
), ),
@ -142,7 +138,7 @@ function block_schema() {
'fields' => array( 'fields' => array(
'bid' => array( 'bid' => array(
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'description' => t("The block's {blocks}.bid."), 'description' => t("The block's {blocks}.bid."),
), ),
@ -167,7 +163,9 @@ function block_schema() {
'description' => t("Block body's {filter_formats}.format; for example, 1 = Filtered HTML."), 'description' => t("Block body's {filter_formats}.format; for example, 1 = Filtered HTML."),
) )
), ),
'unique keys' => array('info' => array('info')), 'unique keys' => array(
'info' => array('info'),
),
'primary key' => array('bid'), 'primary key' => array('bid'),
); );

View File

@ -165,9 +165,10 @@ function comment_schema() {
) )
), ),
'indexes' => array( 'indexes' => array(
'pid' => array('pid'), 'pid' => array('pid'),
'nid' => array('nid'), 'nid' => array('nid'),
'status' => array('status'), // This index is probably unused // This index is probably unused.
'status' => array('status'),
), ),
'primary key' => array('cid'), 'primary key' => array('cid'),
); );
@ -210,10 +211,9 @@ function comment_schema() {
), ),
'primary key' => array('nid'), 'primary key' => array('nid'),
'indexes' => array( 'indexes' => array(
'node_comment_timestamp' => array('last_comment_timestamp') 'node_comment_timestamp' => array('last_comment_timestamp'),
), ),
); );
return $schema; return $schema;
} }

View File

@ -96,9 +96,10 @@ function dblog_schema() {
), ),
), ),
'primary key' => array('wid'), 'primary key' => array('wid'),
'indexes' => array('type' => array('type')), 'indexes' => array(
'type' => array('type'),
),
); );
return $schema; return $schema;
} }

View File

@ -87,7 +87,9 @@ function filter_schema() {
) )
), ),
'primary key' => array('format'), 'primary key' => array('format'),
'unique keys' => array('name' => array('name')), 'unique keys' => array(
'name' => array('name'),
),
); );
$schema['cache_filter'] = drupal_get_schema_unprocessed('system', 'cache'); $schema['cache_filter'] = drupal_get_schema_unprocessed('system', 'cache');

View File

@ -92,7 +92,7 @@ function forum_schema() {
), ),
'indexes' => array( 'indexes' => array(
'nid' => array('nid'), 'nid' => array('nid'),
'tid' => array('tid') 'tid' => array('tid'),
), ),
'primary key' => array('vid'), 'primary key' => array('vid'),
); );

View File

@ -12,83 +12,98 @@ function node_schema() {
'description' => t('The primary identifier for a node.'), 'description' => t('The primary identifier for a node.'),
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE), 'not null' => TRUE,
),
'vid' => array( 'vid' => array(
'description' => t('The current {node_revisions}.vid version identifier.'), 'description' => t('The current {node_revisions}.vid version identifier.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'type' => array( 'type' => array(
'description' => t('The {node_type}.type of this node.'), 'description' => t('The {node_type}.type of this node.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 32,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'language' => array( 'language' => array(
'description' => t('The {languages}.language of this node.'), 'description' => t('The {languages}.language of this node.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 12, 'length' => 12,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'title' => array( 'title' => array(
'description' => t('The title of this node, always treated a non-markup plain text.'), 'description' => t('The title of this node, always treated a non-markup plain text.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'uid' => array( 'uid' => array(
'description' => t('The {users}.uid that owns this node; initially, this is the user that created it.'), 'description' => t('The {users}.uid that owns this node; initially, this is the user that created it.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'status' => array( 'status' => array(
'description' => t('Boolean indicating whether the node is published (visible to non-administrators).'), 'description' => t('Boolean indicating whether the node is published (visible to non-administrators).'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 1), 'default' => 1,
),
'created' => array( 'created' => array(
'description' => t('The Unix timestamp when the node was created.'), 'description' => t('The Unix timestamp when the node was created.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'changed' => array( 'changed' => array(
'description' => t('The Unix timestamp when the node was most recently saved.'), 'description' => t('The Unix timestamp when the node was most recently saved.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'comment' => array( 'comment' => array(
'description' => t('Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.'), 'description' => t('Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'promote' => array( 'promote' => array(
'description' => t('Boolean indicating whether the node should displayed on the front page.'), 'description' => t('Boolean indicating whether the node should displayed on the front page.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'moderate' => array( 'moderate' => array(
'description' => t('Previously, a boolean indicating whether the node was "in moderation"; mostly no longer used.'), 'description' => t('Previously, a boolean indicating whether the node was "in moderation"; mostly no longer used.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'sticky' => array( 'sticky' => array(
'description' => t('Boolean indicating whether the node should be displayed at the top of lists in which it appears.'), 'description' => t('Boolean indicating whether the node should be displayed at the top of lists in which it appears.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'tnid' => array( 'tnid' => array(
'description' => t('The translation set id for this node, which equals the node id of the source post in each set.'), 'description' => t('The translation set id for this node, which equals the node id of the source post in each set.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'translate' => array( 'translate' => array(
'description' => t('A boolean indicating whether this translation page needs to be updated.'), 'description' => t('A boolean indicating whether this translation page needs to be updated.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
), ),
),
'indexes' => array( 'indexes' => array(
'node_changed' => array('changed'), 'node_changed' => array('changed'),
'node_created' => array('created'), 'node_created' => array('created'),
@ -100,12 +115,12 @@ function node_schema() {
'uid' => array('uid'), 'uid' => array('uid'),
'tnid' => array('tnid'), 'tnid' => array('tnid'),
'translate' => array('translate'), 'translate' => array('translate'),
), ),
'unique keys' => array( 'unique keys' => array(
'vid' => array('vid') 'vid' => array('vid'),
), ),
'primary key' => array('nid'), 'primary key' => array('nid'),
); );
$schema['node_access'] = array( $schema['node_access'] = array(
'description' => t('Identifies which realm/grant pairs a user must possess in order to view, update, or delete specific nodes.'), 'description' => t('Identifies which realm/grant pairs a user must possess in order to view, update, or delete specific nodes.'),
@ -115,43 +130,49 @@ function node_schema() {
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'gid' => array( 'gid' => array(
'description' => t("The grant ID a user must possess in the specified realm to gain this row's privileges on the node."), 'description' => t("The grant ID a user must possess in the specified realm to gain this row's privileges on the node."),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'realm' => array( 'realm' => array(
'description' => t('The realm in which the user must possess the grant ID. Each node access node can define one or more realms.'), 'description' => t('The realm in which the user must possess the grant ID. Each node access node can define one or more realms.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'grant_view' => array( 'grant_view' => array(
'description' => t('Boolean indicating whether a user with the realm/grant pair can view this node.'), 'description' => t('Boolean indicating whether a user with the realm/grant pair can view this node.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'tiny'), 'size' => 'tiny',
),
'grant_update' => array( 'grant_update' => array(
'description' => t('Boolean indicating whether a user with the realm/grant pair can edit this node.'), 'description' => t('Boolean indicating whether a user with the realm/grant pair can edit this node.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'tiny'), 'size' => 'tiny',
),
'grant_delete' => array( 'grant_delete' => array(
'description' => t('Boolean indicating whether a user with the realm/grant pair can delete this node.'), 'description' => t('Boolean indicating whether a user with the realm/grant pair can delete this node.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'tiny') 'size' => 'tiny',
), ),
),
'primary key' => array('nid', 'gid', 'realm'), 'primary key' => array('nid', 'gid', 'realm'),
); );
$schema['node_counter'] = array( $schema['node_counter'] = array(
'description' => t('Access statistics for {node}s.'), 'description' => t('Access statistics for {node}s.'),
@ -160,30 +181,34 @@ function node_schema() {
'description' => t('The {node}.nid for these statistics.'), 'description' => t('The {node}.nid for these statistics.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'totalcount' => array( 'totalcount' => array(
'description' => t('The total number of times the {node} has been viewed.'), 'description' => t('The total number of times the {node} has been viewed.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'big'), 'size' => 'big',
),
'daycount' => array( 'daycount' => array(
'description' => t('The total number of times the {node} has been viewed today.'), 'description' => t('The total number of times the {node} has been viewed today.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'medium'), 'size' => 'medium',
),
'timestamp' => array( 'timestamp' => array(
'description' => t('The most recent time the {node} has been viewed.'), 'description' => t('The most recent time the {node} has been viewed.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0) 'default' => 0,
), ),
),
'primary key' => array('nid'), 'primary key' => array('nid'),
); );
$schema['node_revisions'] = array( $schema['node_revisions'] = array(
'description' => t('Stores information about each saved version of a {node}.'), 'description' => t('Stores information about each saved version of a {node}.'),
@ -193,55 +218,64 @@ function node_schema() {
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'vid' => array( 'vid' => array(
'description' => t('The primary identifier for this version.'), 'description' => t('The primary identifier for this version.'),
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE), 'not null' => TRUE,
),
'uid' => array( 'uid' => array(
'description' => t('The {users}.uid that created this version.'), 'description' => t('The {users}.uid that created this version.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'title' => array( 'title' => array(
'description' => t('The title of this version.'), 'description' => t('The title of this version.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'body' => array( 'body' => array(
'description' => t('The body of this version.'), 'description' => t('The body of this version.'),
'type' => 'text', 'type' => 'text',
'not null' => TRUE, 'not null' => TRUE,
'size' => 'big'), 'size' => 'big',
),
'teaser' => array( 'teaser' => array(
'description' => t('The teaser of this version.'), 'description' => t('The teaser of this version.'),
'type' => 'text', 'type' => 'text',
'not null' => TRUE, 'not null' => TRUE,
'size' => 'big'), 'size' => 'big',
),
'log' => array( 'log' => array(
'description' => t('The log entry explaining the changes in this version.'), 'description' => t('The log entry explaining the changes in this version.'),
'type' => 'text', 'type' => 'text',
'not null' => TRUE, 'not null' => TRUE,
'size' => 'big'), 'size' => 'big',
),
'timestamp' => array( 'timestamp' => array(
'description' => t('A Unix timestamp indicating when this version was created.'), 'description' => t('A Unix timestamp indicating when this version was created.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'format' => array( 'format' => array(
'description' => t("The input format used by this version's body."), 'description' => t("The input format used by this version's body."),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0) 'default' => 0,
), ),
),
'indexes' => array( 'indexes' => array(
'nid' => array('nid'), 'nid' => array('nid'),
'uid' => array('uid') 'uid' => array('uid'),
), ),
'primary key' => array('vid'), 'primary key' => array('vid'),
); );
$schema['node_type'] = array( $schema['node_type'] = array(
'description' => t('Stores information about all defined {node} types.'), 'description' => t('Stores information about all defined {node} types.'),
@ -250,86 +284,99 @@ function node_schema() {
'description' => t('The machine-readable name of this type.'), 'description' => t('The machine-readable name of this type.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 32,
'not null' => TRUE), 'not null' => TRUE,
),
'name' => array( 'name' => array(
'description' => t('The human-readable name of this type.'), 'description' => t('The human-readable name of this type.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'module' => array( 'module' => array(
'description' => t('The module that implements this type.'), 'description' => t('The module that implements this type.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE), 'not null' => TRUE,
'description' => array( ),
'description' => array(
'description' => t('A brief description of this type.'), 'description' => t('A brief description of this type.'),
'type' => 'text', 'type' => 'text',
'not null' => TRUE, 'not null' => TRUE,
'size' => 'medium'), 'size' => 'medium',
),
'help' => array( 'help' => array(
'description' => t('Help information shown to the user when creating a {node} of this type.'), 'description' => t('Help information shown to the user when creating a {node} of this type.'),
'type' => 'text', 'type' => 'text',
'not null' => TRUE, 'not null' => TRUE,
'size' => 'medium'), 'size' => 'medium',
),
'has_title' => array( 'has_title' => array(
'description' => t('Boolean indicating whether this type uses the {node}.title field.'), 'description' => t('Boolean indicating whether this type uses the {node}.title field.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'size' => 'tiny'), 'size' => 'tiny',
),
'title_label' => array( 'title_label' => array(
'description' => t('The label displayed for the title field on the edit form.'), 'description' => t('The label displayed for the title field on the edit form.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'has_body' => array( 'has_body' => array(
'description' => t('Boolean indicating whether this type uses the {node_revisions}.body field.'), 'description' => t('Boolean indicating whether this type uses the {node_revisions}.body field.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'size' => 'tiny'), 'size' => 'tiny',
),
'body_label' => array( 'body_label' => array(
'description' => t('The label displayed for the body field on the edit form.'), 'description' => t('The label displayed for the body field on the edit form.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'min_word_count' => array( 'min_word_count' => array(
'description' => t('The minimum number of words the body must contain.'), 'description' => t('The minimum number of words the body must contain.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'size' => 'small'), 'size' => 'small',
),
'custom' => array( 'custom' => array(
'description' => t('A boolean indicating whether this type is defined by a module (FALSE) or by a user via a module like the Content Construction Kit (TRUE).'), 'description' => t('A boolean indicating whether this type is defined by a module (FALSE) or by a user via a module like the Content Construction Kit (TRUE).'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'tiny'), 'size' => 'tiny',
),
'modified' => array( 'modified' => array(
'description' => t('A boolean indicating whether this type has been modified by an administrator; currently not used in any way.'), 'description' => t('A boolean indicating whether this type has been modified by an administrator; currently not used in any way.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'tiny'), 'size' => 'tiny',
),
'locked' => array( 'locked' => array(
'description' => t('A boolean indicating whether the administrator can change the machine name of this type.'), 'description' => t('A boolean indicating whether the administrator can change the machine name of this type.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'tiny'), 'size' => 'tiny',
),
'orig_type' => array( 'orig_type' => array(
'description' => t('The original machine-readable name of this node type. This may be different from the current type name if the locked field is 0.'), 'description' => t('The original machine-readable name of this node type. This may be different from the current type name if the locked field is 0.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => '') 'default' => '',
), ),
),
'primary key' => array('type'), 'primary key' => array('type'),
); );
return $schema; return $schema;
} }

View File

@ -24,109 +24,108 @@ function poll_schema() {
$schema['poll'] = array( $schema['poll'] = array(
'description' => t('Stores poll-specific information for poll nodes.'), 'description' => t('Stores poll-specific information for poll nodes.'),
'fields' => array( 'fields' => array(
'nid' => array( 'nid' => array(
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'description' => t("The poll's {node}.nid.") 'description' => t("The poll's {node}.nid."),
), ),
'runtime' => array( 'runtime' => array(
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'description' => t('The number of seconds past {node}.created during which the poll is open.') 'description' => t('The number of seconds past {node}.created during which the poll is open.'),
), ),
'active' => array( 'active' => array(
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'description' => t('Boolean indicating whether or not the poll is open.'), 'description' => t('Boolean indicating whether or not the poll is open.'),
),
), ),
),
'primary key' => array('nid'), 'primary key' => array('nid'),
); );
$schema['poll_choices'] = array( $schema['poll_choices'] = array(
'description' => t('Stores information about all choices for all {poll}s.'), 'description' => t('Stores information about all choices for all {poll}s.'),
'fields' => array( 'fields' => array(
'chid' => array( 'chid' => array(
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'description' => t('Unique identifier for a poll choice.'), 'description' => t('Unique identifier for a poll choice.'),
), ),
'nid' => array( 'nid' => array(
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'description' => t('The {node}.nid this choice belongs to.'), 'description' => t('The {node}.nid this choice belongs to.'),
), ),
'chtext' => array( 'chtext' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 128, 'length' => 128,
'not null' => TRUE, 'not null' => TRUE,
'default' => '', 'default' => '',
'description' => t('The text for this choice.'), 'description' => t('The text for this choice.'),
), ),
'chvotes' => array( 'chvotes' => array(
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'description' => t('The total number of votes this choice has received by all users.'), 'description' => t('The total number of votes this choice has received by all users.'),
), ),
'chorder' => array( 'chorder' => array(
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'description' => t('The sort order of this choice among all choices for the same node.'), 'description' => t('The sort order of this choice among all choices for the same node.'),
)
), ),
),
'indexes' => array( 'indexes' => array(
'nid' => array('nid') 'nid' => array('nid'),
), ),
'primary key' => array('chid'), 'primary key' => array('chid'),
); );
$schema['poll_votes'] = array( $schema['poll_votes'] = array(
'description' => t('Stores per-{users} votes for each {poll}.'), 'description' => t('Stores per-{users} votes for each {poll}.'),
'fields' => array( 'fields' => array(
'nid' => array( 'nid' => array(
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'description' => t('The {poll} node this vote is for.'), 'description' => t('The {poll} node this vote is for.'),
), ),
'uid' => array( 'uid' => array(
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'description' => t('The {users}.uid this vote is from unless the voter was anonymous.'), 'description' => t('The {users}.uid this vote is from unless the voter was anonymous.'),
), ),
'chorder' => array( 'chorder' => array(
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => -1, 'default' => -1,
'description' => t("The {users}'s vote for this poll."), 'description' => t("The {users}'s vote for this poll."),
), ),
'hostname' => array( 'hostname' => array(
'type' => 'varchar', 'type' => 'varchar',
'length' => 128, 'length' => 128,
'not null' => TRUE, 'not null' => TRUE,
'default' => '', 'default' => '',
'description' => t('The IP address this vote is from unless the voter was logged in.'), 'description' => t('The IP address this vote is from unless the voter was logged in.'),
),
), ),
),
'primary key' => array('nid', 'uid', 'hostname'), 'primary key' => array('nid', 'uid', 'hostname'),
'indexes' => array( 'indexes' => array(
'hostname' => array('hostname'), 'hostname' => array('hostname'),
'uid' => array('uid'), 'uid' => array('uid'),
), ),
); );
return $schema; return $schema;
} }

View File

@ -108,8 +108,12 @@ function profile_schema() {
'description' => t('List of options to be used in a list selection field.'), 'description' => t('List of options to be used in a list selection field.'),
), ),
), ),
'indexes' => array('category' => array('category')), 'indexes' => array(
'unique keys' => array('name' => array('name')), 'category' => array('category'),
),
'unique keys' => array(
'name' => array('name'),
),
'primary key' => array('fid'), 'primary key' => array('fid'),
); );
@ -144,4 +148,3 @@ function profile_schema() {
return $schema; return $schema;
} }

View File

@ -55,7 +55,9 @@ function search_schema() {
'description' => t('Set to force node reindexing.'), 'description' => t('Set to force node reindexing.'),
), ),
), ),
'unique keys' => array('sid_type' => array('sid', 'type')), 'unique keys' => array(
'sid_type' => array('sid', 'type'),
),
); );
$schema['search_index'] = array( $schema['search_index'] = array(
@ -89,9 +91,11 @@ function search_schema() {
), ),
'indexes' => array( 'indexes' => array(
'sid_type' => array('sid', 'type'), 'sid_type' => array('sid', 'type'),
'word' => array('word') 'word' => array('word'),
),
'unique keys' => array(
'word_sid_type' => array('word', 'sid', 'type'),
), ),
'unique keys' => array('word_sid_type' => array('word', 'sid', 'type')),
); );
$schema['search_total'] = array( $schema['search_total'] = array(
@ -145,9 +149,10 @@ function search_schema() {
), ),
), ),
'primary key' => array('sid', 'type', 'nid'), 'primary key' => array('sid', 'type', 'nid'),
'indexes' => array('nid' => array('nid')), 'indexes' => array(
'nid' => array('nid'),
),
); );
return $schema; return $schema;
} }

View File

@ -421,15 +421,17 @@ function system_schema() {
'type' => 'varchar', 'type' => 'varchar',
'length' => 128, 'length' => 128,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'value' => array( 'value' => array(
'description' => t('The value of the variable.'), 'description' => t('The value of the variable.'),
'type' => 'text', 'type' => 'text',
'not null' => TRUE, 'not null' => TRUE,
'size' => 'big'), 'size' => 'big',
), ),
),
'primary key' => array('name'), 'primary key' => array('name'),
); );
$schema['actions'] = array( $schema['actions'] = array(
'description' => t('Stores action information.'), 'description' => t('Stores action information.'),
@ -439,33 +441,38 @@ function system_schema() {
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => '0'), 'default' => '0',
),
'type' => array( 'type' => array(
'description' => t('The object that that action acts on (node, user, comment, system or custom types.)'), 'description' => t('The object that that action acts on (node, user, comment, system or custom types.)'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 32,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'callback' => array( 'callback' => array(
'description' => t('The callback function that executes when the action runs.'), 'description' => t('The callback function that executes when the action runs.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'parameters' => array( 'parameters' => array(
'description' => t('Parameters to be passed to the callback function.'), 'description' => t('Parameters to be passed to the callback function.'),
'type' => 'text', 'type' => 'text',
'not null' => TRUE, 'not null' => TRUE,
'size' => 'big'), 'size' => 'big',
),
'description' => array( 'description' => array(
'description' => t('Description of the action.'), 'description' => t('Description of the action.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => '0'), 'default' => '0',
), ),
),
'primary key' => array('aid'), 'primary key' => array('aid'),
); );
$schema['actions_aid'] = array( $schema['actions_aid'] = array(
'description' => t('Stores action IDs for non-default actions.'), 'description' => t('Stores action IDs for non-default actions.'),
@ -474,10 +481,11 @@ function system_schema() {
'description' => t('Primary Key: Unique actions ID.'), 'description' => t('Primary Key: Unique actions ID.'),
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE), 'not null' => TRUE,
), ),
),
'primary key' => array('aid'), 'primary key' => array('aid'),
); );
$schema['batch'] = array( $schema['batch'] = array(
'description' => t('Stores details about batches (processes that run in multiple HTTP requests).'), 'description' => t('Stores details about batches (processes that run in multiple HTTP requests).'),
@ -486,25 +494,31 @@ function system_schema() {
'description' => t('Primary Key: Unique batch ID.'), 'description' => t('Primary Key: Unique batch ID.'),
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE), 'not null' => TRUE,
),
'token' => array( 'token' => array(
'description' => t("A string token generated against the current user's session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it."), 'description' => t("A string token generated against the current user's session id and the batch id, used to ensure that only the user who submitted the batch can effectively access it."),
'type' => 'varchar', 'type' => 'varchar',
'length' => 64, 'length' => 64,
'not null' => TRUE), 'not null' => TRUE,
),
'timestamp' => array( 'timestamp' => array(
'description' => t('A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.'), 'description' => t('A Unix timestamp indicating when this batch was submitted for processing. Stale batches are purged at cron time.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE), 'not null' => TRUE,
),
'batch' => array( 'batch' => array(
'description' => t('A serialized array containing the processing data for the batch.'), 'description' => t('A serialized array containing the processing data for the batch.'),
'type' => 'text', 'type' => 'text',
'not null' => FALSE, 'not null' => FALSE,
'size' => 'big') 'size' => 'big',
), ),
),
'primary key' => array('bid'), 'primary key' => array('bid'),
'indexes' => array('token' => array('token')), 'indexes' => array(
); 'token' => array('token'),
),
);
$schema['cache'] = array( $schema['cache'] = array(
'description' => t('Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.'), 'description' => t('Generic cache table for caching things not separated out into their own tables. Contributed modules may also use this to store cached items.'),
@ -514,36 +528,44 @@ function system_schema() {
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'data' => array( 'data' => array(
'description' => t('A collection of data to cache.'), 'description' => t('A collection of data to cache.'),
'type' => 'blob', 'type' => 'blob',
'not null' => FALSE, 'not null' => FALSE,
'size' => 'big'), 'size' => 'big',
),
'expire' => array( 'expire' => array(
'description' => t('A Unix timestamp indicating when the cache entry should expire, or 0 for never.'), 'description' => t('A Unix timestamp indicating when the cache entry should expire, or 0 for never.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'created' => array( 'created' => array(
'description' => t('A Unix timestamp indicating when the cache entry was created.'), 'description' => t('A Unix timestamp indicating when the cache entry was created.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'headers' => array( 'headers' => array(
'description' => t('Any custom HTTP headers to be added to cached data.'), 'description' => t('Any custom HTTP headers to be added to cached data.'),
'type' => 'text', 'type' => 'text',
'not null' => FALSE), 'not null' => FALSE,
),
'serialized' => array( 'serialized' => array(
'description' => t('A flag to indicate whether content is serialized (1) or not (0).'), 'description' => t('A flag to indicate whether content is serialized (1) or not (0).'),
'type' => 'int', 'type' => 'int',
'size' => 'small', 'size' => 'small',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0) 'default' => 0,
), ),
'indexes' => array('expire' => array('expire')), ),
'indexes' => array(
'expire' => array('expire'),
),
'primary key' => array('cid'), 'primary key' => array('cid'),
); );
$schema['cache_form'] = $schema['cache']; $schema['cache_form'] = $schema['cache'];
$schema['cache_form']['description'] = t('Cache table for the form system to store recently built forms and their storage data, to be used in subsequent page requests.'); $schema['cache_form']['description'] = t('Cache table for the form system to store recently built forms and their storage data, to be used in subsequent page requests.');
@ -559,56 +581,64 @@ function system_schema() {
'description' => t('Primary Key: Unique files ID.'), 'description' => t('Primary Key: Unique files ID.'),
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE), 'not null' => TRUE,
),
'uid' => array( 'uid' => array(
'description' => t('The {users}.uid of the user who is associated with the file.'), 'description' => t('The {users}.uid of the user who is associated with the file.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'filename' => array( 'filename' => array(
'description' => t('Name of the file.'), 'description' => t('Name of the file.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'filepath' => array( 'filepath' => array(
'description' => t('Path of the file relative to Drupal root.'), 'description' => t('Path of the file relative to Drupal root.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'filemime' => array( 'filemime' => array(
'description' => t('The file MIME type.'), 'description' => t('The file MIME type.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'filesize' => array( 'filesize' => array(
'description' => t('The size of the file in bytes.'), 'description' => t('The size of the file in bytes.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'status' => array( 'status' => array(
'description' => t('A flag indicating whether file is temporary (1) or permanent (0).'), 'description' => t('A flag indicating whether file is temporary (1) or permanent (0).'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'timestamp' => array( 'timestamp' => array(
'description' => t('UNIX timestamp for when the file was added.'), 'description' => t('UNIX timestamp for when the file was added.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
), ),
),
'indexes' => array( 'indexes' => array(
'uid' => array('uid'), 'uid' => array('uid'),
'status' => array('status'), 'status' => array('status'),
'timestamp' => array('timestamp'), 'timestamp' => array('timestamp'),
), ),
'primary key' => array('fid'), 'primary key' => array('fid'),
); );
$schema['flood'] = array( $schema['flood'] = array(
'description' => t('Flood controls the threshold of events, such as the number of contact attempts.'), 'description' => t('Flood controls the threshold of events, such as the number of contact attempts.'),
@ -616,30 +646,34 @@ function system_schema() {
'fid' => array( 'fid' => array(
'description' => t('Unique flood event ID.'), 'description' => t('Unique flood event ID.'),
'type' => 'serial', 'type' => 'serial',
'not null' => TRUE), 'not null' => TRUE,
),
'event' => array( 'event' => array(
'description' => t('Name of event (e.g. contact).'), 'description' => t('Name of event (e.g. contact).'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 64, 'length' => 64,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'hostname' => array( 'hostname' => array(
'description' => t('Hostname of the visitor.'), 'description' => t('Hostname of the visitor.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 128, 'length' => 128,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'timestamp' => array( 'timestamp' => array(
'description' => t('Timestamp of the event.'), 'description' => t('Timestamp of the event.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0) 'default' => 0,
), ),
),
'primary key' => array('fid'), 'primary key' => array('fid'),
'indexes' => array( 'indexes' => array(
'allow' => array('event', 'hostname', 'timestamp'), 'allow' => array('event', 'hostname', 'timestamp'),
), ),
); );
$schema['history'] = array( $schema['history'] = array(
'description' => t('A record of which {users} have read which {node}s.'), 'description' => t('A record of which {users} have read which {node}s.'),
@ -648,23 +682,26 @@ function system_schema() {
'description' => t('The {users}.uid that read the {node} nid.'), 'description' => t('The {users}.uid that read the {node} nid.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'nid' => array( 'nid' => array(
'description' => t('The {node}.nid that was read.'), 'description' => t('The {node}.nid that was read.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'timestamp' => array( 'timestamp' => array(
'description' => t('The Unix timestamp at which the read occurred.'), 'description' => t('The Unix timestamp at which the read occurred.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0) 'default' => 0,
), ),
),
'primary key' => array('uid', 'nid'), 'primary key' => array('uid', 'nid'),
'indexes' => array( 'indexes' => array(
'nid' => array('nid'), 'nid' => array('nid'),
), ),
); );
$schema['menu_router'] = array( $schema['menu_router'] = array(
'description' => t('Maps paths to various callbacks (access, page and title)'), 'description' => t('Maps paths to various callbacks (access, page and title)'),
'fields' => array( 'fields' => array(
@ -673,117 +710,137 @@ function system_schema() {
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'load_functions' => array( 'load_functions' => array(
'description' => t('A serialized array of function names (like node_load) to be called to load an object corresponding to a part of the current path.'), 'description' => t('A serialized array of function names (like node_load) to be called to load an object corresponding to a part of the current path.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'to_arg_functions' => array( 'to_arg_functions' => array(
'description' => t('A serialized array of function names (like user_current_to_arg) to be called to replace a part of the router path with another string.'), 'description' => t('A serialized array of function names (like user_current_to_arg) to be called to replace a part of the router path with another string.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'access_callback' => array( 'access_callback' => array(
'description' => t('The callback which determines the access to this router path. Defaults to user_access.'), 'description' => t('The callback which determines the access to this router path. Defaults to user_access.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'access_arguments' => array( 'access_arguments' => array(
'description' => t('A serialized array of arguments for the access callback.'), 'description' => t('A serialized array of arguments for the access callback.'),
'type' => 'text', 'type' => 'text',
'not null' => FALSE), 'not null' => FALSE,
),
'page_callback' => array( 'page_callback' => array(
'description' => t('The name of the function that renders the page.'), 'description' => t('The name of the function that renders the page.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'page_arguments' => array( 'page_arguments' => array(
'description' => t('A serialized array of arguments for the page callback.'), 'description' => t('A serialized array of arguments for the page callback.'),
'type' => 'text', 'type' => 'text',
'not null' => FALSE), 'not null' => FALSE,
),
'fit' => array( 'fit' => array(
'description' => t('A numeric representation of how specific the path is.'), 'description' => t('A numeric representation of how specific the path is.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'number_parts' => array( 'number_parts' => array(
'description' => t('Number of parts in this router path.'), 'description' => t('Number of parts in this router path.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'small'), 'size' => 'small',
),
'tab_parent' => array( 'tab_parent' => array(
'description' => t('Only for local tasks (tabs) - the router path of the parent page (which may also be a local task).'), 'description' => t('Only for local tasks (tabs) - the router path of the parent page (which may also be a local task).'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'tab_root' => array( 'tab_root' => array(
'description' => t('Router path of the closest non-tab parent page. For pages that are not local tasks, this will be the same as the path.'), 'description' => t('Router path of the closest non-tab parent page. For pages that are not local tasks, this will be the same as the path.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'title' => array( 'title' => array(
'description' => t('The title for the current page, or the title for the tab if this is a local task.'), 'description' => t('The title for the current page, or the title for the tab if this is a local task.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'title_callback' => array( 'title_callback' => array(
'description' => t('A function which will alter the title. Defaults to t()'), 'description' => t('A function which will alter the title. Defaults to t()'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'title_arguments' => array( 'title_arguments' => array(
'description' => t('A serialized array of arguments for the title callback. If empty, the title will be used as the sole argument for the title callback.'), 'description' => t('A serialized array of arguments for the title callback. If empty, the title will be used as the sole argument for the title callback.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'type' => array( 'type' => array(
'description' => t('Numeric representation of the type of the menu item, like MENU_LOCAL_TASK.'), 'description' => t('Numeric representation of the type of the menu item, like MENU_LOCAL_TASK.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'block_callback' => array( 'block_callback' => array(
'description' => t('Name of a function used to render the block on the system administration page for this item.'), 'description' => t('Name of a function used to render the block on the system administration page for this item.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'description' => array( 'description' => array(
'description' => t('A description of this item.'), 'description' => t('A description of this item.'),
'type' => 'text', 'type' => 'text',
'not null' => TRUE), 'not null' => TRUE,
),
'position' => array( 'position' => array(
'description' => t('The position of the block (left or right) on the system administration page for this item.'), 'description' => t('The position of the block (left or right) on the system administration page for this item.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'weight' => array( 'weight' => array(
'description' => t('Weight of the element. Lighter weights are higher up, heavier weights go down.'), 'description' => t('Weight of the element. Lighter weights are higher up, heavier weights go down.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'file' => array( 'file' => array(
'description' => t('The file to include for this element, usually the page callback function lives in this file.'), 'description' => t('The file to include for this element, usually the page callback function lives in this file.'),
'type' => 'text', 'type' => 'text',
'size' => 'medium') 'size' => 'medium',
), ),
),
'indexes' => array( 'indexes' => array(
'fit' => array('fit'), 'fit' => array('fit'),
'tab_parent' => array('tab_parent') 'tab_parent' => array('tab_parent'),
), ),
'primary key' => array('path'), 'primary key' => array('path'),
); );
$schema['menu_links'] = array( $schema['menu_links'] = array(
'description' => t('Contains the individual links within a menu.'), 'description' => t('Contains the individual links within a menu.'),
@ -793,158 +850,181 @@ function system_schema() {
'type' => 'varchar', 'type' => 'varchar',
'length' => 32, 'length' => 32,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'mlid' => array( 'mlid' => array(
'description' => t('The menu link ID (mlid) is the integer primary key.'), 'description' => t('The menu link ID (mlid) is the integer primary key.'),
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE), 'not null' => TRUE,
),
'plid' => array( 'plid' => array(
'description' => t('The parent link ID (plid) is the mlid of the link above in the hierarchy, or zero if the link is at the top level in its menu.'), 'description' => t('The parent link ID (plid) is the mlid of the link above in the hierarchy, or zero if the link is at the top level in its menu.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'link_path' => array( 'link_path' => array(
'description' => t('The Drupal path or external path this link points to.'), 'description' => t('The Drupal path or external path this link points to.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'router_path' => array( 'router_path' => array(
'description' => t('For links corresponding to a Drupal path (external = 0), this connects the link to a {menu_router}.path for joins.'), 'description' => t('For links corresponding to a Drupal path (external = 0), this connects the link to a {menu_router}.path for joins.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'link_title' => array( 'link_title' => array(
'description' => t('The text displayed for the link, which may be modified by a title callback stored in {menu_router}.'), 'description' => t('The text displayed for the link, which may be modified by a title callback stored in {menu_router}.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'options' => array( 'options' => array(
'description' => t('A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.'), 'description' => t('A serialized array of options to be passed to the url() or l() function, such as a query string or HTML attributes.'),
'type' => 'text', 'type' => 'text',
'not null' => FALSE), 'not null' => FALSE,
),
'module' => array( 'module' => array(
'description' => t('The name of the module that generated this link.'), 'description' => t('The name of the module that generated this link.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => 'system'), 'default' => 'system',
),
'hidden' => array( 'hidden' => array(
'description' => t('A flag for whether the link should be rendered in menus. (1 = a disabled menu item that may be shown on admin screens, -1 = a menu callback, 0 = a normal, visible link)'), 'description' => t('A flag for whether the link should be rendered in menus. (1 = a disabled menu item that may be shown on admin screens, -1 = a menu callback, 0 = a normal, visible link)'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'small'), 'size' => 'small',
),
'external' => array( 'external' => array(
'description' => t('A flag to indicate if the link points to a full URL starting with a protocol, like http:// (1 = external, 0 = internal).'), 'description' => t('A flag to indicate if the link points to a full URL starting with a protocol, like http:// (1 = external, 0 = internal).'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'small'), 'size' => 'small',
),
'has_children' => array( 'has_children' => array(
'description' => t('Flag indicating whether any links have this link as a parent (1 = children exist, 0 = no children).'), 'description' => t('Flag indicating whether any links have this link as a parent (1 = children exist, 0 = no children).'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'small'), 'size' => 'small',
),
'expanded' => array( 'expanded' => array(
'description' => t('Flag for whether this link should be rendered as expanded in menus - expanded links always have their child links displayed, instead of only when the link is in the active trail (1 = expanded, 0 = not expanded)'), 'description' => t('Flag for whether this link should be rendered as expanded in menus - expanded links always have their child links displayed, instead of only when the link is in the active trail (1 = expanded, 0 = not expanded)'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'small'), 'size' => 'small',
),
'weight' => array( 'weight' => array(
'description' => t('Link weight among links in the same menu at the same depth.'), 'description' => t('Link weight among links in the same menu at the same depth.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'depth' => array( 'depth' => array(
'description' => t('The depth relative to the top level. A link with plid == 0 will have depth == 1.'), 'description' => t('The depth relative to the top level. A link with plid == 0 will have depth == 1.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'small'), 'size' => 'small',
),
'customized' => array( 'customized' => array(
'description' => t('A flag to indicate that the user has manually created or edited the link (1 = customized, 0 = not customized).'), 'description' => t('A flag to indicate that the user has manually created or edited the link (1 = customized, 0 = not customized).'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'small'), 'size' => 'small',
),
'p1' => array( 'p1' => array(
'description' => t('The first mlid in the materialized path. If N = depth, then pN must equal the mlid. If depth > 1 then p(N-1) must equal the plid. All pX where X > depth must equal zero. The columns p1 .. p9 are also called the parents.'), 'description' => t('The first mlid in the materialized path. If N = depth, then pN must equal the mlid. If depth > 1 then p(N-1) must equal the plid. All pX where X > depth must equal zero. The columns p1 .. p9 are also called the parents.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'p2' => array( 'p2' => array(
'description' => t('The second mlid in the materialized path. See p1.'), 'description' => t('The second mlid in the materialized path. See p1.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'p3' => array( 'p3' => array(
'description' => t('The third mlid in the materialized path. See p1.'), 'description' => t('The third mlid in the materialized path. See p1.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'p4' => array( 'p4' => array(
'description' => t('The fourth mlid in the materialized path. See p1.'), 'description' => t('The fourth mlid in the materialized path. See p1.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'p5' => array( 'p5' => array(
'description' => t('The fifth mlid in the materialized path. See p1.'), 'description' => t('The fifth mlid in the materialized path. See p1.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'p6' => array( 'p6' => array(
'description' => t('The sixth mlid in the materialized path. See p1.'), 'description' => t('The sixth mlid in the materialized path. See p1.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'p7' => array( 'p7' => array(
'description' => t('The seventh mlid in the materialized path. See p1.'), 'description' => t('The seventh mlid in the materialized path. See p1.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'p8' => array( 'p8' => array(
'description' => t('The eighth mlid in the materialized path. See p1.'), 'description' => t('The eighth mlid in the materialized path. See p1.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'p9' => array( 'p9' => array(
'description' => t('The ninth mlid in the materialized path. See p1.'), 'description' => t('The ninth mlid in the materialized path. See p1.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'updated' => array( 'updated' => array(
'description' => t('Flag that indicates that this link was generated during the update from Drupal 5.'), 'description' => t('Flag that indicates that this link was generated during the update from Drupal 5.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'small'), 'size' => 'small',
), ),
),
'indexes' => array( 'indexes' => array(
'path_menu' => array(array('link_path', 128), 'menu_name'), 'path_menu' => array(array('link_path', 128), 'menu_name'),
'menu_plid_expand_child' => array( 'menu_plid_expand_child' => array('menu_name', 'plid', 'expanded', 'has_children'),
'menu_name', 'plid', 'expanded', 'has_children'), 'menu_parents' => array('menu_name', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9'),
'menu_parents' => array(
'menu_name', 'p1', 'p2', 'p3', 'p4', 'p5', 'p6', 'p7', 'p8', 'p9'),
'router_path' => array(array('router_path', 128)), 'router_path' => array(array('router_path', 128)),
), ),
'primary key' => array('mlid'), 'primary key' => array('mlid'),
); );
$schema['sessions'] = array( $schema['sessions'] = array(
'description' => t("Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated."), 'description' => t("Drupal's session handlers read and write into the sessions table. Each record represents a user session, either anonymous or authenticated."),
@ -953,41 +1033,47 @@ function system_schema() {
'description' => t('The {users}.uid corresponding to a session, or 0 for anonymous user.'), 'description' => t('The {users}.uid corresponding to a session, or 0 for anonymous user.'),
'type' => 'int', 'type' => 'int',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE), 'not null' => TRUE,
),
'sid' => array( 'sid' => array(
'description' => t("Primary key: A session ID. The value is generated by PHP's Session API."), 'description' => t("Primary key: A session ID. The value is generated by PHP's Session API."),
'type' => 'varchar', 'type' => 'varchar',
'length' => 64, 'length' => 64,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'hostname' => array( 'hostname' => array(
'description' => t('The IP address that last used this session ID (sid).'), 'description' => t('The IP address that last used this session ID (sid).'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 128, 'length' => 128,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'timestamp' => array( 'timestamp' => array(
'description' => t('The Unix timestamp when this session last requested a page. Old records are purged by PHP automatically.'), 'description' => t('The Unix timestamp when this session last requested a page. Old records are purged by PHP automatically.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'cache' => array( 'cache' => array(
'description' => t("The time of this user's last post. This is used when the site has specified a minimum_cache_lifetime. See cache_get()."), 'description' => t("The time of this user's last post. This is used when the site has specified a minimum_cache_lifetime. See cache_get()."),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'session' => array( 'session' => array(
'description' => t('The serialized contents of $_SESSION, an array of name/value pairs that persists across page requests by this session ID. Drupal loads $_SESSION from here at the start of each request and saves it at the end.'), 'description' => t('The serialized contents of $_SESSION, an array of name/value pairs that persists across page requests by this session ID. Drupal loads $_SESSION from here at the start of each request and saves it at the end.'),
'type' => 'text', 'type' => 'text',
'not null' => FALSE, 'not null' => FALSE,
'size' => 'big') 'size' => 'big',
), ),
),
'primary key' => array('sid'), 'primary key' => array('sid'),
'indexes' => array( 'indexes' => array(
'timestamp' => array('timestamp'), 'timestamp' => array('timestamp'),
'uid' => array('uid') 'uid' => array('uid'),
), ),
); );
$schema['system'] = array( $schema['system'] = array(
'description' => t("A list of all modules, themes, and theme engines that are or have been installed in Drupal's file system."), 'description' => t("A list of all modules, themes, and theme engines that are or have been installed in Drupal's file system."),
@ -997,64 +1083,73 @@ function system_schema() {
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'name' => array( 'name' => array(
'description' => t('The name of the item; e.g. node.'), 'description' => t('The name of the item; e.g. node.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'type' => array( 'type' => array(
'description' => t('The type of the item, either module, theme, or theme_engine.'), 'description' => t('The type of the item, either module, theme, or theme_engine.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'owner' => array( 'owner' => array(
'description' => t("A theme's 'parent'. Can be either a theme or an engine."), 'description' => t("A theme's 'parent'. Can be either a theme or an engine."),
'type' => 'varchar', 'type' => 'varchar',
'length' => 255, 'length' => 255,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'status' => array( 'status' => array(
'description' => t('Boolean indicating whether or not this item is enabled.'), 'description' => t('Boolean indicating whether or not this item is enabled.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'throttle' => array( 'throttle' => array(
'description' => t('Boolean indicating whether this item is disabled when the throttle.module disables throttleable items.'), 'description' => t('Boolean indicating whether this item is disabled when the throttle.module disables throttleable items.'),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0, 'default' => 0,
'size' => 'tiny'), 'size' => 'tiny',
),
'bootstrap' => array( 'bootstrap' => array(
'description' => t("Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted)."), 'description' => t("Boolean indicating whether this module is loaded during Drupal's early bootstrapping phase (e.g. even before the page cache is consulted)."),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'schema_version' => array( 'schema_version' => array(
'description' => t("The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed."), 'description' => t("The module's database schema version number. -1 if the module is not installed (its tables do not exist); 0 or the largest N of the module's hook_update_N() function that has either been run or existed when the module was first installed."),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => -1, 'default' => -1,
'size' => 'small'), 'size' => 'small',
),
'weight' => array( 'weight' => array(
'description' => t("The order in which this module's hooks should be invoked relative to other modules. Equal-weighted modules are ordered by name."), 'description' => t("The order in which this module's hooks should be invoked relative to other modules. Equal-weighted modules are ordered by name."),
'type' => 'int', 'type' => 'int',
'not null' => TRUE, 'not null' => TRUE,
'default' => 0), 'default' => 0,
),
'info' => array( 'info' => array(
'description' => t("A serialized array containing information from the module's .info file; keys can include name, description, package, version, core, dependencies, dependents, and php."), 'description' => t("A serialized array containing information from the module's .info file; keys can include name, description, package, version, core, dependencies, dependents, and php."),
'type' => 'text', 'type' => 'text',
'not null' => FALSE) 'not null' => FALSE,
), ),
),
'primary key' => array('filename'), 'primary key' => array('filename'),
'indexes' => 'indexes' => array(
array( 'modules' => array(array('type', 12), 'status', 'weight', 'filename'),
'modules' => array(array('type', 12), 'status', 'weight', 'filename'), 'bootstrap' => array(array('type', 12), 'status', 'bootstrap', 'weight', 'filename'),
'bootstrap' => array(array('type', 12), 'status', 'bootstrap', 'weight', 'filename'), ),
), );
);
$schema['url_alias'] = array( $schema['url_alias'] = array(
'description' => t('A list of URL aliases for Drupal paths; a user may visit either the source or destination path.'), 'description' => t('A list of URL aliases for Drupal paths; a user may visit either the source or destination path.'),
@ -1063,30 +1158,38 @@ function system_schema() {
'description' => t('A unique path alias identifier.'), 'description' => t('A unique path alias identifier.'),
'type' => 'serial', 'type' => 'serial',
'unsigned' => TRUE, 'unsigned' => TRUE,
'not null' => TRUE), 'not null' => TRUE,
),
'src' => array( 'src' => array(
'description' => t('The Drupal path this alias is for; e.g. node/12.'), 'description' => t('The Drupal path this alias is for; e.g. node/12.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 128, 'length' => 128,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'dst' => array( 'dst' => array(
'description' => t('The alias for this path; e.g. title-of-the-story.'), 'description' => t('The alias for this path; e.g. title-of-the-story.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 128, 'length' => 128,
'not null' => TRUE, 'not null' => TRUE,
'default' => ''), 'default' => '',
),
'language' => array( 'language' => array(
'description' => t('The language this alias is for; if blank, the alias will be used for unknown languages. Each Drupal path can have an alias for each supported language.'), 'description' => t('The language this alias is for; if blank, the alias will be used for unknown languages. Each Drupal path can have an alias for each supported language.'),
'type' => 'varchar', 'type' => 'varchar',
'length' => 12, 'length' => 12,
'not null' => TRUE, 'not null' => TRUE,
'default' => '') 'default' => '',
), ),
'unique keys' => array('dst_language' => array('dst', 'language')), ),
'unique keys' => array(
'dst_language' => array('dst', 'language'),
),
'primary key' => array('pid'), 'primary key' => array('pid'),
'indexes' => array('src' => array('src')), 'indexes' => array(
); 'src' => array('src'),
),
);
return $schema; return $schema;
} }

View File

@ -68,7 +68,9 @@ function user_schema() {
'description' => t('Module which is controlling the authentication.'), 'description' => t('Module which is controlling the authentication.'),
), ),
), ),
'unique keys' => array('authname' => array('authname')), 'unique keys' => array(
'authname' => array('authname'),
),
'primary key' => array('aid'), 'primary key' => array('aid'),
); );
@ -102,7 +104,9 @@ function user_schema() {
), ),
), ),
'primary key' => array('pid'), 'primary key' => array('pid'),
'indexes' => array('rid' => array('rid')), 'indexes' => array(
'rid' => array('rid'),
),
); );
$schema['role'] = array( $schema['role'] = array(
@ -122,7 +126,9 @@ function user_schema() {
'description' => t('Unique role name.'), 'description' => t('Unique role name.'),
), ),
), ),
'unique keys' => array('name' => array('name')), 'unique keys' => array(
'name' => array('name'),
),
'primary key' => array('rid'), 'primary key' => array('rid'),
); );