Mercurial > defr > drupal > core
comparison modules/poll/poll.install @ 19:3edae6ecd6c6 6.9
Drupal 6.9
| author | Franck Deroche <franck@defr.org> |
|---|---|
| date | Thu, 15 Jan 2009 10:15:56 +0100 |
| parents | c1f4ac30525a |
| children |
comparison
equal
deleted
inserted
replaced
| 18:f5131a9cd9e5 | 19:3edae6ecd6c6 |
|---|---|
| 1 <?php | 1 <?php |
| 2 // $Id: poll.install,v 1.13 2007/12/18 12:59:21 dries Exp $ | 2 // $Id: poll.install,v 1.13.2.1 2009/01/06 15:46:37 goba Exp $ |
| 3 | 3 |
| 4 /** | 4 /** |
| 5 * Implementation of hook_install(). | 5 * Implementation of hook_install(). |
| 6 */ | 6 */ |
| 7 function poll_install() { | 7 function poll_install() { |
| 20 /** | 20 /** |
| 21 * Implementation of hook_schema(). | 21 * Implementation of hook_schema(). |
| 22 */ | 22 */ |
| 23 function poll_schema() { | 23 function poll_schema() { |
| 24 $schema['poll'] = array( | 24 $schema['poll'] = array( |
| 25 'description' => t('Stores poll-specific information for poll nodes.'), | 25 'description' => 'Stores poll-specific information for poll nodes.', |
| 26 'fields' => array( | 26 'fields' => array( |
| 27 'nid' => array( | 27 'nid' => array( |
| 28 'type' => 'int', | 28 'type' => 'int', |
| 29 'unsigned' => TRUE, | 29 'unsigned' => TRUE, |
| 30 'not null' => TRUE, | 30 'not null' => TRUE, |
| 31 'default' => 0, | 31 'default' => 0, |
| 32 'description' => t("The poll's {node}.nid.") | 32 'description' => "The poll's {node}.nid." |
| 33 ), | 33 ), |
| 34 'runtime' => array( | 34 'runtime' => array( |
| 35 'type' => 'int', | 35 'type' => 'int', |
| 36 'not null' => TRUE, | 36 'not null' => TRUE, |
| 37 'default' => 0, | 37 'default' => 0, |
| 38 'description' => t('The number of seconds past {node}.created during which the poll is open.') | 38 'description' => 'The number of seconds past {node}.created during which the poll is open.' |
| 39 ), | 39 ), |
| 40 'active' => array( | 40 'active' => array( |
| 41 'type' => 'int', | 41 'type' => 'int', |
| 42 'unsigned' => TRUE, | 42 'unsigned' => TRUE, |
| 43 'not null' => TRUE, | 43 'not null' => TRUE, |
| 44 'default' => 0, | 44 'default' => 0, |
| 45 'description' => t('Boolean indicating whether or not the poll is open.'), | 45 'description' => 'Boolean indicating whether or not the poll is open.', |
| 46 ), | 46 ), |
| 47 ), | 47 ), |
| 48 'primary key' => array('nid'), | 48 'primary key' => array('nid'), |
| 49 ); | 49 ); |
| 50 | 50 |
| 51 $schema['poll_choices'] = array( | 51 $schema['poll_choices'] = array( |
| 52 'description' => t('Stores information about all choices for all {poll}s.'), | 52 'description' => 'Stores information about all choices for all {poll}s.', |
| 53 'fields' => array( | 53 'fields' => array( |
| 54 'chid' => array( | 54 'chid' => array( |
| 55 'type' => 'serial', | 55 'type' => 'serial', |
| 56 'unsigned' => TRUE, | 56 'unsigned' => TRUE, |
| 57 'not null' => TRUE, | 57 'not null' => TRUE, |
| 58 'description' => t('Unique identifier for a poll choice.'), | 58 'description' => 'Unique identifier for a poll choice.', |
| 59 ), | 59 ), |
| 60 'nid' => array( | 60 'nid' => array( |
| 61 'type' => 'int', | 61 'type' => 'int', |
| 62 'unsigned' => TRUE, | 62 'unsigned' => TRUE, |
| 63 'not null' => TRUE, | 63 'not null' => TRUE, |
| 64 'default' => 0, | 64 'default' => 0, |
| 65 'description' => t('The {node}.nid this choice belongs to.'), | 65 'description' => 'The {node}.nid this choice belongs to.', |
| 66 ), | 66 ), |
| 67 'chtext' => array( | 67 'chtext' => array( |
| 68 'type' => 'varchar', | 68 'type' => 'varchar', |
| 69 'length' => 128, | 69 'length' => 128, |
| 70 'not null' => TRUE, | 70 'not null' => TRUE, |
| 71 'default' => '', | 71 'default' => '', |
| 72 'description' => t('The text for this choice.'), | 72 'description' => 'The text for this choice.', |
| 73 ), | 73 ), |
| 74 'chvotes' => array( | 74 'chvotes' => array( |
| 75 'type' => 'int', | 75 'type' => 'int', |
| 76 'not null' => TRUE, | 76 'not null' => TRUE, |
| 77 'default' => 0, | 77 'default' => 0, |
| 78 'description' => t('The total number of votes this choice has received by all users.'), | 78 'description' => 'The total number of votes this choice has received by all users.', |
| 79 ), | 79 ), |
| 80 'chorder' => array( | 80 'chorder' => array( |
| 81 'type' => 'int', | 81 'type' => 'int', |
| 82 'not null' => TRUE, | 82 'not null' => TRUE, |
| 83 'default' => 0, | 83 'default' => 0, |
| 84 'description' => t('The sort order of this choice among all choices for the same node.'), | 84 'description' => 'The sort order of this choice among all choices for the same node.', |
| 85 ) | 85 ) |
| 86 ), | 86 ), |
| 87 'indexes' => array( | 87 'indexes' => array( |
| 88 'nid' => array('nid') | 88 'nid' => array('nid') |
| 89 ), | 89 ), |
| 90 'primary key' => array('chid'), | 90 'primary key' => array('chid'), |
| 91 ); | 91 ); |
| 92 | 92 |
| 93 $schema['poll_votes'] = array( | 93 $schema['poll_votes'] = array( |
| 94 'description' => t('Stores per-{users} votes for each {poll}.'), | 94 'description' => 'Stores per-{users} votes for each {poll}.', |
| 95 'fields' => array( | 95 'fields' => array( |
| 96 'nid' => array( | 96 'nid' => array( |
| 97 'type' => 'int', | 97 'type' => 'int', |
| 98 'unsigned' => TRUE, | 98 'unsigned' => TRUE, |
| 99 'not null' => TRUE, | 99 'not null' => TRUE, |
| 100 'description' => t('The {poll} node this vote is for.'), | 100 'description' => 'The {poll} node this vote is for.', |
| 101 ), | 101 ), |
| 102 'uid' => array( | 102 'uid' => array( |
| 103 'type' => 'int', | 103 'type' => 'int', |
| 104 'unsigned' => TRUE, | 104 'unsigned' => TRUE, |
| 105 'not null' => TRUE, | 105 'not null' => TRUE, |
| 106 'default' => 0, | 106 'default' => 0, |
| 107 'description' => t('The {users}.uid this vote is from unless the voter was anonymous.'), | 107 'description' => 'The {users}.uid this vote is from unless the voter was anonymous.', |
| 108 ), | 108 ), |
| 109 'chorder' => array( | 109 'chorder' => array( |
| 110 'type' => 'int', | 110 'type' => 'int', |
| 111 'not null' => TRUE, | 111 'not null' => TRUE, |
| 112 'default' => -1, | 112 'default' => -1, |
| 113 'description' => t("The {users}'s vote for this poll."), | 113 'description' => "The {users}'s vote for this poll.", |
| 114 ), | 114 ), |
| 115 'hostname' => array( | 115 'hostname' => array( |
| 116 'type' => 'varchar', | 116 'type' => 'varchar', |
| 117 'length' => 128, | 117 'length' => 128, |
| 118 'not null' => TRUE, | 118 'not null' => TRUE, |
| 119 'default' => '', | 119 'default' => '', |
| 120 'description' => t('The IP address this vote is from unless the voter was logged in.'), | 120 'description' => 'The IP address this vote is from unless the voter was logged in.', |
| 121 ), | 121 ), |
| 122 ), | 122 ), |
| 123 'primary key' => array('nid', 'uid', 'hostname'), | 123 'primary key' => array('nid', 'uid', 'hostname'), |
| 124 'indexes' => array( | 124 'indexes' => array( |
| 125 'hostname' => array('hostname'), | 125 'hostname' => array('hostname'), |
