diff options
Diffstat (limited to 'modules/poll/poll.install')
-rw-r--r-- | modules/poll/poll.install | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/modules/poll/poll.install b/modules/poll/poll.install index 4859747c1..3d9b8b9ae 100644 --- a/modules/poll/poll.install +++ b/modules/poll/poll.install @@ -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' => '', 'description' => t('The text for this choice.'), - ), + ), 'chvotes' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => t('The total number of votes this choice has received by all users.'), - ), + ), 'chorder' => array( 'type' => 'int', 'not null' => TRUE, 'default' => 0, 'description' => t('The sort order of this choice among all choices for the same node.'), - ) ), + ), 'indexes' => array( - 'nid' => array('nid') - ), + 'nid' => array('nid'), + ), 'primary key' => array('chid'), - ); + ); $schema['poll_votes'] = array( 'description' => t('Stores per-{users} votes for each {poll}.'), 'fields' => array( - 'nid' => array( + 'nid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'description' => t('The {poll} node this vote is for.'), - ), - 'uid' => array( + ), + 'uid' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'default' => 0, 'description' => t('The {users}.uid this vote is from unless the voter was anonymous.'), - ), - 'chorder' => array( + ), + 'chorder' => array( 'type' => 'int', 'not null' => TRUE, 'default' => -1, 'description' => t("The {users}'s vote for this poll."), - ), + ), 'hostname' => array( 'type' => 'varchar', 'length' => 128, 'not null' => TRUE, 'default' => '', 'description' => t('The IP address this vote is from unless the voter was logged in.'), - ), ), + ), 'primary key' => array('nid', 'uid', 'hostname'), 'indexes' => array( 'hostname' => array('hostname'), - 'uid' => array('uid'), - ), - ); + 'uid' => array('uid'), + ), + ); return $schema; } - |