Révision 62f5c69e
Ajouté par Assos Assos il y a presque 9 ans
drupal7/sites/all/modules/pollfield/pollfield.install | ||
---|---|---|
23 | 23 |
*/ |
24 | 24 |
function pollfield_field_schema($field) { |
25 | 25 |
$columns = array( |
26 |
'question' => array('type' => 'text', 'size' => 'medium', 'not null' => FALSE), |
|
27 |
'choice' => array('type' => 'text', 'size' => 'medium', 'not null' => FALSE), |
|
28 |
'anonymous'=> array('type' => 'text', 'size' => 'small', 'not null' => FALSE), |
|
29 |
'poll_features'=>array('type' => 'text', 'size' => 'medium', 'not null' => FALSE), |
|
30 |
'active' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), |
|
31 |
'runtime'=> array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), |
|
32 |
'votes'=> array('type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE, 'default' => 0), |
|
33 |
); |
|
34 |
$indexes = array( |
|
35 |
|
|
26 |
'question' => array( |
|
27 |
'type' => 'text', |
|
28 |
'size' => 'medium', |
|
29 |
'not null' => FALSE, |
|
30 |
), |
|
31 |
'choice' => array( |
|
32 |
'type' => 'text', |
|
33 |
'size' => 'medium', |
|
34 |
'not null' => FALSE, |
|
35 |
), |
|
36 |
'anonymous' => array( |
|
37 |
'type' => 'text', |
|
38 |
'size' => 'small', |
|
39 |
'not null' => FALSE, |
|
40 |
), |
|
41 |
'poll_features' => array( |
|
42 |
'type' => 'text', |
|
43 |
'size' => 'medium', |
|
44 |
'not null' => FALSE, |
|
45 |
), |
|
46 |
'active' => array( |
|
47 |
'type' => 'int', |
|
48 |
'unsigned' => TRUE, |
|
49 |
'not null' => FALSE, |
|
50 |
'default' => 0, |
|
51 |
), |
|
52 |
'runtime' => array( |
|
53 |
'type' => 'int', |
|
54 |
'unsigned' => TRUE, |
|
55 |
'not null' => FALSE, |
|
56 |
'default' => 0, |
|
57 |
), |
|
58 |
'votes' => array( |
|
59 |
'type' => 'int', |
|
60 |
'unsigned' => TRUE, |
|
61 |
'not null' => FALSE, |
|
62 |
'default' => 0, |
|
63 |
), |
|
36 | 64 |
); |
65 |
$indexes = array(); |
|
37 | 66 |
return array( |
38 | 67 |
'columns' => $columns, |
39 | 68 |
'indexes' => $indexes, |
... | ... | |
46 | 75 |
* @ingroup nodeapi_example |
47 | 76 |
*/ |
48 | 77 |
function pollfield_schema() { |
49 |
|
|
50 |
|
|
51 | 78 |
$schema['pollfield'] = array( |
52 | 79 |
'description' => 'Inventory of all pollfields their basic settings', |
53 | 80 |
'fields' => array( |
... | ... | |
91 | 118 |
'field_table' => array('field_table'), |
92 | 119 |
), |
93 | 120 |
); |
94 |
|
|
121 |
|
|
95 | 122 |
$schema['pollfield_votes'] = array( |
96 | 123 |
'description' => 'Pollfield results table', |
97 | 124 |
'fields' => array( |
... | ... | |
136 | 163 |
'default' => '', |
137 | 164 |
), |
138 | 165 |
|
139 |
'field_name_delta' => array( |
|
166 |
'field_name_delta' => array(
|
|
140 | 167 |
'description' => 'Pollfield delta', |
141 | 168 |
'type' => 'int', |
142 | 169 |
'unsigned' => 1, |
143 | 170 |
'not null' => TRUE, |
144 | 171 |
'default' => 0, |
145 | 172 |
), |
146 |
'weight' => array( |
|
173 |
'weight' => array(
|
|
147 | 174 |
'description' => 'Weight for mulitchoice', |
148 | 175 |
'type' => 'int', |
149 | 176 |
'unsigned' => 1, |
150 | 177 |
'not null' => TRUE, |
151 | 178 |
'default' => 0, |
152 | 179 |
), |
153 |
'cookie' => array( |
|
180 |
'cookie' => array(
|
|
154 | 181 |
'description' => 'Cookie for anonymous voters', |
155 | 182 |
'type' => 'varchar', |
156 |
'length' => 128,
|
|
183 |
'length' => 255,
|
|
157 | 184 |
'not null' => TRUE, |
158 | 185 |
'default' => '', |
159 | 186 |
), |
... | ... | |
169 | 196 |
return $schema; |
170 | 197 |
} |
171 | 198 |
|
199 |
/** |
|
200 |
* Changes size of {pollfield_votes}.cookie column. |
|
201 |
*/ |
|
202 |
function pollfield_update_7001() { |
|
203 |
db_change_field('pollfield_votes', 'cookie', 'cookie', array( |
|
204 |
'description' => 'Cookie for anonymous voters', |
|
205 |
'type' => 'varchar', |
|
206 |
'length' => 255, |
|
207 |
'not null' => TRUE, |
|
208 |
'default' => '', |
|
209 |
)); |
|
210 |
} |
|
211 |
|
|
172 | 212 |
/** |
173 | 213 |
* Implements hook_uninstall(). |
174 | 214 |
* |
Formats disponibles : Unified diff
Weekly update of contrib modules