Commit f5d4287c authored by Dries's avatar Dries

- Patch #214271 by recidive: improved schema identation.

parent 637ec935
......@@ -56,7 +56,9 @@ function aggregator_schema() {
)
),
'primary key' => array('cid'),
'unique keys' => array('title' => array('title')),
'unique keys' => array(
'title' => array('title'),
),
);
$schema['aggregator_category_feed'] = array(
......@@ -76,7 +78,9 @@ function aggregator_schema() {
)
),
'primary key' => array('cid', 'fid'),
'indexes' => array('fid' => array('fid')),
'indexes' => array(
'fid' => array('fid'),
),
);
$schema['aggregator_category_item'] = array(
......@@ -96,7 +100,9 @@ function aggregator_schema() {
)
),
'primary key' => array('cid', 'iid'),
'indexes' => array('iid' => array('iid')),
'indexes' => array(
'iid' => array('iid'),
),
);
$schema['aggregator_feed'] = array(
......@@ -234,7 +240,9 @@ function aggregator_schema() {
)
),
'primary key' => array('iid'),
'indexes' => array('fid' => array('fid')),
'indexes' => array(
'fid' => array('fid'),
),
);
return $schema;
......
......@@ -114,7 +114,7 @@ function block_schema() {
'not null' => TRUE,
'description' => t("The block's origin module, from {blocks}.module."),
),
'delta' => array(
'delta' => array(
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
......@@ -127,11 +127,7 @@ function block_schema() {
'description' => t("The user's role ID from {users_roles}.rid."),
),
),
'primary key' => array(
'module',
'delta',
'rid'
),
'primary key' => array('module', 'delta', 'rid'),
'indexes' => array(
'rid' => array('rid'),
),
......@@ -142,7 +138,7 @@ function block_schema() {
'fields' => array(
'bid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'unsigned' => TRUE,
'not null' => TRUE,
'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."),
)
),
'unique keys' => array('info' => array('info')),
'unique keys' => array(
'info' => array('info'),
),
'primary key' => array('bid'),
);
......
......@@ -165,9 +165,10 @@ function comment_schema() {
)
),
'indexes' => array(
'pid' => array('pid'),
'nid' => array('nid'),
'status' => array('status'), // This index is probably unused
'pid' => array('pid'),
'nid' => array('nid'),
// This index is probably unused.
'status' => array('status'),
),
'primary key' => array('cid'),
);
......@@ -210,10 +211,9 @@ function comment_schema() {
),
'primary key' => array('nid'),
'indexes' => array(
'node_comment_timestamp' => array('last_comment_timestamp')
'node_comment_timestamp' => array('last_comment_timestamp'),
),
);
return $schema;
}
......@@ -96,9 +96,10 @@ function dblog_schema() {
),
),
'primary key' => array('wid'),
'indexes' => array('type' => array('type')),
'indexes' => array(
'type' => array('type'),
),
);
return $schema;
}
......@@ -87,7 +87,9 @@ function filter_schema() {
)
),
'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');
......
......@@ -92,7 +92,7 @@ function forum_schema() {
),
'indexes' => array(
'nid' => array('nid'),
'tid' => array('tid')
'tid' => array('tid'),
),
'primary key' => array('vid'),
);
......
......@@ -12,83 +12,98 @@ function node_schema() {
'description' => t('The primary identifier for a node.'),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE),
'not null' => TRUE,
),
'vid' => array(
'description' => t('The current {node_revisions}.vid version identifier.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'type' => array(
'description' => t('The {node_type}.type of this node.'),
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => ''),
'default' => '',
),
'language' => array(
'description' => t('The {languages}.language of this node.'),
'type' => 'varchar',
'length' => 12,
'not null' => TRUE,
'default' => ''),
'default' => '',
),
'title' => array(
'description' => t('The title of this node, always treated a non-markup plain text.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'default' => '',
),
'uid' => array(
'description' => t('The {users}.uid that owns this node; initially, this is the user that created it.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'status' => array(
'description' => t('Boolean indicating whether the node is published (visible to non-administrators).'),
'type' => 'int',
'not null' => TRUE,
'default' => 1),
'default' => 1,
),
'created' => array(
'description' => t('The Unix timestamp when the node was created.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'changed' => array(
'description' => t('The Unix timestamp when the node was most recently saved.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'comment' => array(
'description' => t('Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'promote' => array(
'description' => t('Boolean indicating whether the node should displayed on the front page.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'moderate' => array(
'description' => t('Previously, a boolean indicating whether the node was "in moderation"; mostly no longer used.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'sticky' => array(
'description' => t('Boolean indicating whether the node should be displayed at the top of lists in which it appears.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'tnid' => array(
'description' => t('The translation set id for this node, which equals the node id of the source post in each set.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'translate' => array(
'description' => t('A boolean indicating whether this translation page needs to be updated.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
),
'indexes' => array(
'node_changed' => array('changed'),
'node_created' => array('created'),
......@@ -100,12 +115,12 @@ function node_schema() {
'uid' => array('uid'),
'tnid' => array('tnid'),
'translate' => array('translate'),
),
),
'unique keys' => array(
'vid' => array('vid')
),
'vid' => array('vid'),
),
'primary key' => array('nid'),
);
);
$schema['node_access'] = array(
'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',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'gid' => array(
'description' => t("The grant ID a user must possess in the specified realm to gain this row's privileges on the node."),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'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.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'default' => '',
),
'grant_view' => array(
'description' => t('Boolean indicating whether a user with the realm/grant pair can view this node.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'tiny'),
'size' => 'tiny',
),
'grant_update' => array(
'description' => t('Boolean indicating whether a user with the realm/grant pair can edit this node.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'tiny'),
'size' => 'tiny',
),
'grant_delete' => array(
'description' => t('Boolean indicating whether a user with the realm/grant pair can delete this node.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'tiny')
'size' => 'tiny',
),
),
'primary key' => array('nid', 'gid', 'realm'),
);
);
$schema['node_counter'] = array(
'description' => t('Access statistics for {node}s.'),
......@@ -160,30 +181,34 @@ function node_schema() {
'description' => t('The {node}.nid for these statistics.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'totalcount' => array(
'description' => t('The total number of times the {node} has been viewed.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'big'),
'size' => 'big',
),
'daycount' => array(
'description' => t('The total number of times the {node} has been viewed today.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'size' => 'medium'),
'size' => 'medium',
),
'timestamp' => array(
'description' => t('The most recent time the {node} has been viewed.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0)
'default' => 0,
),
),
'primary key' => array('nid'),
);
);
$schema['node_revisions'] = array(
'description' => t('Stores information about each saved version of a {node}.'),
......@@ -193,55 +218,64 @@ function node_schema() {
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'vid' => array(
'description' => t('The primary identifier for this version.'),
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE),
'not null' => TRUE,
),
'uid' => array(
'description' => t('The {users}.uid that created this version.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'title' => array(
'description' => t('The title of this version.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'default' => '',
),
'body' => array(
'description' => t('The body of this version.'),
'type' => 'text',
'not null' => TRUE,
'size' => 'big'),
'size' => 'big',
),
'teaser' => array(
'description' => t('The teaser of this version.'),
'type' => 'text',
'not null' => TRUE,
'size' => 'big'),
'size' => 'big',
),
'log' => array(
'description' => t('The log entry explaining the changes in this version.'),
'type' => 'text',
'not null' => TRUE,
'size' => 'big'),
'size' => 'big',
),
'timestamp' => array(
'description' => t('A Unix timestamp indicating when this version was created.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0),
'default' => 0,
),
'format' => array(
'description' => t("The input format used by this version's body."),
'type' => 'int',
'not null' => TRUE,
'default' => 0)
'default' => 0,
),
),
'indexes' => array(
'nid' => array('nid'),
'uid' => array('uid')
),
'uid' => array('uid'),
),
'primary key' => array('vid'),
);
);
$schema['node_type'] = array(
'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.'),
'type' => 'varchar',
'length' => 32,
'not null' => TRUE),
'not null' => TRUE,
),
'name' => array(
'description' => t('The human-readable name of this type.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'default' => '',
),
'module' => array(
'description' => t('The module that implements this type.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE),
'description' => array(
'not null' => TRUE,
),
'description' => array(
'description' => t('A brief description of this type.'),
'type' => 'text',
'not null' => TRUE,
'size' => 'medium'),
'size' => 'medium',
),
'help' => array(
'description' => t('Help information shown to the user when creating a {node} of this type.'),
'type' => 'text',
'not null' => TRUE,
'size' => 'medium'),
'size' => 'medium',
),
'has_title' => array(
'description' => t('Boolean indicating whether this type uses the {node}.title field.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'size' => 'tiny'),
'size' => 'tiny',
),
'title_label' => array(
'description' => t('The label displayed for the title field on the edit form.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'default' => '',
),
'has_body' => array(
'description' => t('Boolean indicating whether this type uses the {node_revisions}.body field.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'size' => 'tiny'),
'size' => 'tiny',
),
'body_label' => array(
'description' => t('The label displayed for the body field on the edit form.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => ''),
'default' => '',
),
'min_word_count' => array(
'description' => t('The minimum number of words the body must contain.'),
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'size' => 'small'),
'size' => 'small',
),
'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).'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny'),
'size' => 'tiny',
),
'modified' => array(
'description' => t('A boolean indicating whether this type has been modified by an administrator; currently not used in any way.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny'),
'size' => 'tiny',
),
'locked' => array(
'description' => t('A boolean indicating whether the administrator can change the machine name of this type.'),
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'tiny'),
'size' => 'tiny',
),
'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.'),
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '')
'default' => '',
),
),
'primary key' => array('type'),
);
);
return $schema;
}
......@@ -24,109 +24,108 @@ function poll_schema() {
$schema['poll'] = array(
'description' => t('Stores poll-specific information for poll nodes.'),
'fields' => array(
'nid' => array(
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t("The poll's {node}.nid.")
),
'description' => t("The poll's {node}.nid."),
),
'runtime' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('The number of seconds past {node}.created during which the poll is open.')
),
'active' => array(
'description' => t('The number of seconds past {node}.created during which the poll is open.'),
),
'active' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('Boolean indicating whether or not the poll is open.'),
),
),
),
'primary key' => array('nid'),
);
);
$schema['poll_choices'] = array(
'description' => t('Stores information about all choices for all {poll}s.'),
'fields' => array(
'chid' => array(
'chid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => t('Unique identifier for a poll choice.'),
),
'nid' => array(
),
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => t('The {node}.nid this choice belongs to.'),
),
'chtext' => array(
),
'chtext' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',