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