Mercurial > defr > drupal > core
comparison modules/node/node.install @ 19:3edae6ecd6c6 6.9
Drupal 6.9
author | Franck Deroche <franck@defr.org> |
---|---|
date | Thu, 15 Jan 2009 10:15:56 +0100 |
parents | 4347c45bb494 |
children |
comparison
equal
deleted
inserted
replaced
18:f5131a9cd9e5 | 19:3edae6ecd6c6 |
---|---|
1 <?php | 1 <?php |
2 // $Id: node.install,v 1.4.2.2 2008/12/10 21:24:43 goba Exp $ | 2 // $Id: node.install,v 1.4.2.3 2009/01/06 15:46:37 goba Exp $ |
3 | 3 |
4 /** | 4 /** |
5 * Implementation of hook_schema(). | 5 * Implementation of hook_schema(). |
6 */ | 6 */ |
7 function node_schema() { | 7 function node_schema() { |
8 $schema['node'] = array( | 8 $schema['node'] = array( |
9 'description' => t('The base table for nodes.'), | 9 'description' => 'The base table for nodes.', |
10 'fields' => array( | 10 'fields' => array( |
11 'nid' => array( | 11 'nid' => array( |
12 'description' => t('The primary identifier for a node.'), | 12 'description' => 'The primary identifier for a node.', |
13 'type' => 'serial', | 13 'type' => 'serial', |
14 'unsigned' => TRUE, | 14 'unsigned' => TRUE, |
15 'not null' => TRUE), | 15 'not null' => TRUE), |
16 'vid' => array( | 16 'vid' => array( |
17 'description' => t('The current {node_revisions}.vid version identifier.'), | 17 'description' => 'The current {node_revisions}.vid version identifier.', |
18 'type' => 'int', | 18 'type' => 'int', |
19 'unsigned' => TRUE, | 19 'unsigned' => TRUE, |
20 'not null' => TRUE, | 20 'not null' => TRUE, |
21 'default' => 0), | 21 'default' => 0), |
22 'type' => array( | 22 'type' => array( |
23 'description' => t('The {node_type}.type of this node.'), | 23 'description' => 'The {node_type}.type of this node.', |
24 'type' => 'varchar', | 24 'type' => 'varchar', |
25 'length' => 32, | 25 'length' => 32, |
26 'not null' => TRUE, | 26 'not null' => TRUE, |
27 'default' => ''), | 27 'default' => ''), |
28 'language' => array( | 28 'language' => array( |
29 'description' => t('The {languages}.language of this node.'), | 29 'description' => 'The {languages}.language of this node.', |
30 'type' => 'varchar', | 30 'type' => 'varchar', |
31 'length' => 12, | 31 'length' => 12, |
32 'not null' => TRUE, | 32 'not null' => TRUE, |
33 'default' => ''), | 33 'default' => ''), |
34 'title' => array( | 34 'title' => array( |
35 'description' => t('The title of this node, always treated as non-markup plain text.'), | 35 'description' => 'The title of this node, always treated as non-markup plain text.', |
36 'type' => 'varchar', | 36 'type' => 'varchar', |
37 'length' => 255, | 37 'length' => 255, |
38 'not null' => TRUE, | 38 'not null' => TRUE, |
39 'default' => ''), | 39 'default' => ''), |
40 'uid' => array( | 40 'uid' => array( |
41 'description' => t('The {users}.uid that owns this node; initially, this is the user that created it.'), | 41 'description' => 'The {users}.uid that owns this node; initially, this is the user that created it.', |
42 'type' => 'int', | 42 'type' => 'int', |
43 'not null' => TRUE, | 43 'not null' => TRUE, |
44 'default' => 0), | 44 'default' => 0), |
45 'status' => array( | 45 'status' => array( |
46 'description' => t('Boolean indicating whether the node is published (visible to non-administrators).'), | 46 'description' => 'Boolean indicating whether the node is published (visible to non-administrators).', |
47 'type' => 'int', | 47 'type' => 'int', |
48 'not null' => TRUE, | 48 'not null' => TRUE, |
49 'default' => 1), | 49 'default' => 1), |
50 'created' => array( | 50 'created' => array( |
51 'description' => t('The Unix timestamp when the node was created.'), | 51 'description' => 'The Unix timestamp when the node was created.', |
52 'type' => 'int', | 52 'type' => 'int', |
53 'not null' => TRUE, | 53 'not null' => TRUE, |
54 'default' => 0), | 54 'default' => 0), |
55 'changed' => array( | 55 'changed' => array( |
56 'description' => t('The Unix timestamp when the node was most recently saved.'), | 56 'description' => 'The Unix timestamp when the node was most recently saved.', |
57 'type' => 'int', | 57 'type' => 'int', |
58 'not null' => TRUE, | 58 'not null' => TRUE, |
59 'default' => 0), | 59 'default' => 0), |
60 'comment' => array( | 60 'comment' => array( |
61 'description' => t('Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.'), | 61 'description' => 'Whether comments are allowed on this node: 0 = no, 1 = read only, 2 = read/write.', |
62 'type' => 'int', | 62 'type' => 'int', |
63 'not null' => TRUE, | 63 'not null' => TRUE, |
64 'default' => 0), | 64 'default' => 0), |
65 'promote' => array( | 65 'promote' => array( |
66 'description' => t('Boolean indicating whether the node should be displayed on the front page.'), | 66 'description' => 'Boolean indicating whether the node should be displayed on the front page.', |
67 'type' => 'int', | 67 'type' => 'int', |
68 'not null' => TRUE, | 68 'not null' => TRUE, |
69 'default' => 0), | 69 'default' => 0), |
70 'moderate' => array( | 70 'moderate' => array( |
71 'description' => t('Previously, a boolean indicating whether the node was "in moderation"; mostly no longer used.'), | 71 'description' => 'Previously, a boolean indicating whether the node was "in moderation"; mostly no longer used.', |
72 'type' => 'int', | 72 'type' => 'int', |
73 'not null' => TRUE, | 73 'not null' => TRUE, |
74 'default' => 0), | 74 'default' => 0), |
75 'sticky' => array( | 75 'sticky' => array( |
76 'description' => t('Boolean indicating whether the node should be displayed at the top of lists in which it appears.'), | 76 'description' => 'Boolean indicating whether the node should be displayed at the top of lists in which it appears.', |
77 'type' => 'int', | 77 'type' => 'int', |
78 'not null' => TRUE, | 78 'not null' => TRUE, |
79 'default' => 0), | 79 'default' => 0), |
80 'tnid' => array( | 80 'tnid' => array( |
81 'description' => t('The translation set id for this node, which equals the node id of the source post in each set.'), | 81 'description' => 'The translation set id for this node, which equals the node id of the source post in each set.', |
82 'type' => 'int', | 82 'type' => 'int', |
83 'unsigned' => TRUE, | 83 'unsigned' => TRUE, |
84 'not null' => TRUE, | 84 'not null' => TRUE, |
85 'default' => 0), | 85 'default' => 0), |
86 'translate' => array( | 86 'translate' => array( |
87 'description' => t('A boolean indicating whether this translation page needs to be updated.'), | 87 'description' => 'A boolean indicating whether this translation page needs to be updated.', |
88 'type' => 'int', | 88 'type' => 'int', |
89 'not null' => TRUE, | 89 'not null' => TRUE, |
90 'default' => 0), | 90 'default' => 0), |
91 ), | 91 ), |
92 'indexes' => array( | 92 'indexes' => array( |
106 ), | 106 ), |
107 'primary key' => array('nid'), | 107 'primary key' => array('nid'), |
108 ); | 108 ); |
109 | 109 |
110 $schema['node_access'] = array( | 110 $schema['node_access'] = array( |
111 'description' => t('Identifies which realm/grant pairs a user must possess in order to view, update, or delete specific nodes.'), | 111 'description' => 'Identifies which realm/grant pairs a user must possess in order to view, update, or delete specific nodes.', |
112 'fields' => array( | 112 'fields' => array( |
113 'nid' => array( | 113 'nid' => array( |
114 'description' => t('The {node}.nid this record affects.'), | 114 'description' => 'The {node}.nid this record affects.', |
115 'type' => 'int', | 115 'type' => 'int', |
116 'unsigned' => TRUE, | 116 'unsigned' => TRUE, |
117 'not null' => TRUE, | 117 'not null' => TRUE, |
118 'default' => 0), | 118 'default' => 0), |
119 'gid' => array( | 119 'gid' => array( |
120 'description' => t("The grant ID a user must possess in the specified realm to gain this row's privileges on the node."), | 120 'description' => "The grant ID a user must possess in the specified realm to gain this row's privileges on the node.", |
121 'type' => 'int', | 121 'type' => 'int', |
122 'unsigned' => TRUE, | 122 'unsigned' => TRUE, |
123 'not null' => TRUE, | 123 'not null' => TRUE, |
124 'default' => 0), | 124 'default' => 0), |
125 'realm' => array( | 125 'realm' => array( |
126 'description' => t('The realm in which the user must possess the grant ID. Each node access node can define one or more realms.'), | 126 'description' => 'The realm in which the user must possess the grant ID. Each node access node can define one or more realms.', |
127 'type' => 'varchar', | 127 'type' => 'varchar', |
128 'length' => 255, | 128 'length' => 255, |
129 'not null' => TRUE, | 129 'not null' => TRUE, |
130 'default' => ''), | 130 'default' => ''), |
131 'grant_view' => array( | 131 'grant_view' => array( |
132 'description' => t('Boolean indicating whether a user with the realm/grant pair can view this node.'), | 132 'description' => 'Boolean indicating whether a user with the realm/grant pair can view this node.', |
133 'type' => 'int', | 133 'type' => 'int', |
134 'unsigned' => TRUE, | 134 'unsigned' => TRUE, |
135 'not null' => TRUE, | 135 'not null' => TRUE, |
136 'default' => 0, | 136 'default' => 0, |
137 'size' => 'tiny'), | 137 'size' => 'tiny'), |
138 'grant_update' => array( | 138 'grant_update' => array( |
139 'description' => t('Boolean indicating whether a user with the realm/grant pair can edit this node.'), | 139 'description' => 'Boolean indicating whether a user with the realm/grant pair can edit this node.', |
140 'type' => 'int', | 140 'type' => 'int', |
141 'unsigned' => TRUE, | 141 'unsigned' => TRUE, |
142 'not null' => TRUE, | 142 'not null' => TRUE, |
143 'default' => 0, | 143 'default' => 0, |
144 'size' => 'tiny'), | 144 'size' => 'tiny'), |
145 'grant_delete' => array( | 145 'grant_delete' => array( |
146 'description' => t('Boolean indicating whether a user with the realm/grant pair can delete this node.'), | 146 'description' => 'Boolean indicating whether a user with the realm/grant pair can delete this node.', |
147 'type' => 'int', | 147 'type' => 'int', |
148 'unsigned' => TRUE, | 148 'unsigned' => TRUE, |
149 'not null' => TRUE, | 149 'not null' => TRUE, |
150 'default' => 0, | 150 'default' => 0, |
151 'size' => 'tiny') | 151 'size' => 'tiny') |
152 ), | 152 ), |
153 'primary key' => array('nid', 'gid', 'realm'), | 153 'primary key' => array('nid', 'gid', 'realm'), |
154 ); | 154 ); |
155 | 155 |
156 $schema['node_counter'] = array( | 156 $schema['node_counter'] = array( |
157 'description' => t('Access statistics for {node}s.'), | 157 'description' => 'Access statistics for {node}s.', |
158 'fields' => array( | 158 'fields' => array( |
159 'nid' => array( | 159 'nid' => array( |
160 'description' => t('The {node}.nid for these statistics.'), | 160 'description' => 'The {node}.nid for these statistics.', |
161 'type' => 'int', | 161 'type' => 'int', |
162 'not null' => TRUE, | 162 'not null' => TRUE, |
163 'default' => 0), | 163 'default' => 0), |
164 'totalcount' => array( | 164 'totalcount' => array( |
165 'description' => t('The total number of times the {node} has been viewed.'), | 165 'description' => 'The total number of times the {node} has been viewed.', |
166 'type' => 'int', | 166 'type' => 'int', |
167 'unsigned' => TRUE, | 167 'unsigned' => TRUE, |
168 'not null' => TRUE, | 168 'not null' => TRUE, |
169 'default' => 0, | 169 'default' => 0, |
170 'size' => 'big'), | 170 'size' => 'big'), |
171 'daycount' => array( | 171 'daycount' => array( |
172 'description' => t('The total number of times the {node} has been viewed today.'), | 172 'description' => 'The total number of times the {node} has been viewed today.', |
173 'type' => 'int', | 173 'type' => 'int', |
174 'unsigned' => TRUE, | 174 'unsigned' => TRUE, |
175 'not null' => TRUE, | 175 'not null' => TRUE, |
176 'default' => 0, | 176 'default' => 0, |
177 'size' => 'medium'), | 177 'size' => 'medium'), |
178 'timestamp' => array( | 178 'timestamp' => array( |
179 'description' => t('The most recent time the {node} has been viewed.'), | 179 'description' => 'The most recent time the {node} has been viewed.', |
180 'type' => 'int', | 180 'type' => 'int', |
181 'unsigned' => TRUE, | 181 'unsigned' => TRUE, |
182 'not null' => TRUE, | 182 'not null' => TRUE, |
183 'default' => 0) | 183 'default' => 0) |
184 ), | 184 ), |
185 'primary key' => array('nid'), | 185 'primary key' => array('nid'), |
186 ); | 186 ); |
187 | 187 |
188 $schema['node_revisions'] = array( | 188 $schema['node_revisions'] = array( |
189 'description' => t('Stores information about each saved version of a {node}.'), | 189 'description' => 'Stores information about each saved version of a {node}.', |
190 'fields' => array( | 190 'fields' => array( |
191 'nid' => array( | 191 'nid' => array( |
192 'description' => t('The {node} this version belongs to.'), | 192 'description' => 'The {node} this version belongs to.', |
193 'type' => 'int', | 193 'type' => 'int', |
194 'unsigned' => TRUE, | 194 'unsigned' => TRUE, |
195 'not null' => TRUE, | 195 'not null' => TRUE, |
196 'default' => 0), | 196 'default' => 0), |
197 'vid' => array( | 197 'vid' => array( |
198 'description' => t('The primary identifier for this version.'), | 198 'description' => 'The primary identifier for this version.', |
199 'type' => 'serial', | 199 'type' => 'serial', |
200 'unsigned' => TRUE, | 200 'unsigned' => TRUE, |
201 'not null' => TRUE), | 201 'not null' => TRUE), |
202 'uid' => array( | 202 'uid' => array( |
203 'description' => t('The {users}.uid that created this version.'), | 203 'description' => 'The {users}.uid that created this version.', |
204 'type' => 'int', | 204 'type' => 'int', |
205 'not null' => TRUE, | 205 'not null' => TRUE, |
206 'default' => 0), | 206 'default' => 0), |
207 'title' => array( | 207 'title' => array( |
208 'description' => t('The title of this version.'), | 208 'description' => 'The title of this version.', |
209 'type' => 'varchar', | 209 'type' => 'varchar', |
210 'length' => 255, | 210 'length' => 255, |
211 'not null' => TRUE, | 211 'not null' => TRUE, |
212 'default' => ''), | 212 'default' => ''), |
213 'body' => array( | 213 'body' => array( |
214 'description' => t('The body of this version.'), | 214 'description' => 'The body of this version.', |
215 'type' => 'text', | 215 'type' => 'text', |
216 'not null' => TRUE, | 216 'not null' => TRUE, |
217 'size' => 'big'), | 217 'size' => 'big'), |
218 'teaser' => array( | 218 'teaser' => array( |
219 'description' => t('The teaser of this version.'), | 219 'description' => 'The teaser of this version.', |
220 'type' => 'text', | 220 'type' => 'text', |
221 'not null' => TRUE, | 221 'not null' => TRUE, |
222 'size' => 'big'), | 222 'size' => 'big'), |
223 'log' => array( | 223 'log' => array( |
224 'description' => t('The log entry explaining the changes in this version.'), | 224 'description' => 'The log entry explaining the changes in this version.', |
225 'type' => 'text', | 225 'type' => 'text', |
226 'not null' => TRUE, | 226 'not null' => TRUE, |
227 'size' => 'big'), | 227 'size' => 'big'), |
228 'timestamp' => array( | 228 'timestamp' => array( |
229 'description' => t('A Unix timestamp indicating when this version was created.'), | 229 'description' => 'A Unix timestamp indicating when this version was created.', |
230 'type' => 'int', | 230 'type' => 'int', |
231 'not null' => TRUE, | 231 'not null' => TRUE, |
232 'default' => 0), | 232 'default' => 0), |
233 'format' => array( | 233 'format' => array( |
234 'description' => t("The input format used by this version's body."), | 234 'description' => "The input format used by this version's body.", |
235 'type' => 'int', | 235 'type' => 'int', |
236 'not null' => TRUE, | 236 'not null' => TRUE, |
237 'default' => 0) | 237 'default' => 0) |
238 ), | 238 ), |
239 'indexes' => array( | 239 'indexes' => array( |
242 ), | 242 ), |
243 'primary key' => array('vid'), | 243 'primary key' => array('vid'), |
244 ); | 244 ); |
245 | 245 |
246 $schema['node_type'] = array( | 246 $schema['node_type'] = array( |
247 'description' => t('Stores information about all defined {node} types.'), | 247 'description' => 'Stores information about all defined {node} types.', |
248 'fields' => array( | 248 'fields' => array( |
249 'type' => array( | 249 'type' => array( |
250 'description' => t('The machine-readable name of this type.'), | 250 'description' => 'The machine-readable name of this type.', |
251 'type' => 'varchar', | 251 'type' => 'varchar', |
252 'length' => 32, | 252 'length' => 32, |
253 'not null' => TRUE), | 253 'not null' => TRUE), |
254 'name' => array( | 254 'name' => array( |
255 'description' => t('The human-readable name of this type.'), | 255 'description' => 'The human-readable name of this type.', |
256 'type' => 'varchar', | 256 'type' => 'varchar', |
257 'length' => 255, | 257 'length' => 255, |
258 'not null' => TRUE, | 258 'not null' => TRUE, |
259 'default' => ''), | 259 'default' => ''), |
260 'module' => array( | 260 'module' => array( |
261 'description' => t('The base string used to construct callbacks corresponding to this node type.'), | 261 'description' => 'The base string used to construct callbacks corresponding to this node type.', |
262 'type' => 'varchar', | 262 'type' => 'varchar', |
263 'length' => 255, | 263 'length' => 255, |
264 'not null' => TRUE), | 264 'not null' => TRUE), |
265 'description' => array( | 265 'description' => array( |
266 'description' => t('A brief description of this type.'), | 266 'description' => 'A brief description of this type.', |
267 'type' => 'text', | 267 'type' => 'text', |
268 'not null' => TRUE, | 268 'not null' => TRUE, |
269 'size' => 'medium'), | 269 'size' => 'medium'), |
270 'help' => array( | 270 'help' => array( |
271 'description' => t('Help information shown to the user when creating a {node} of this type.'), | 271 'description' => 'Help information shown to the user when creating a {node} of this type.', |
272 'type' => 'text', | 272 'type' => 'text', |
273 'not null' => TRUE, | 273 'not null' => TRUE, |
274 'size' => 'medium'), | 274 'size' => 'medium'), |
275 'has_title' => array( | 275 'has_title' => array( |
276 'description' => t('Boolean indicating whether this type uses the {node}.title field.'), | 276 'description' => 'Boolean indicating whether this type uses the {node}.title field.', |
277 'type' => 'int', | 277 'type' => 'int', |
278 'unsigned' => TRUE, | 278 'unsigned' => TRUE, |
279 'not null' => TRUE, | 279 'not null' => TRUE, |
280 'size' => 'tiny'), | 280 'size' => 'tiny'), |
281 'title_label' => array( | 281 'title_label' => array( |
282 'description' => t('The label displayed for the title field on the edit form.'), | 282 'description' => 'The label displayed for the title field on the edit form.', |
283 'type' => 'varchar', | 283 'type' => 'varchar', |
284 'length' => 255, | 284 'length' => 255, |
285 'not null' => TRUE, | 285 'not null' => TRUE, |
286 'default' => ''), | 286 'default' => ''), |
287 'has_body' => array( | 287 'has_body' => array( |
288 'description' => t('Boolean indicating whether this type uses the {node_revisions}.body field.'), | 288 'description' => 'Boolean indicating whether this type uses the {node_revisions}.body field.', |
289 'type' => 'int', | 289 'type' => 'int', |
290 'unsigned' => TRUE, | 290 'unsigned' => TRUE, |
291 'not null' => TRUE, | 291 'not null' => TRUE, |
292 'size' => 'tiny'), | 292 'size' => 'tiny'), |
293 'body_label' => array( | 293 'body_label' => array( |
294 'description' => t('The label displayed for the body field on the edit form.'), | 294 'description' => 'The label displayed for the body field on the edit form.', |
295 'type' => 'varchar', | 295 'type' => 'varchar', |
296 'length' => 255, | 296 'length' => 255, |
297 'not null' => TRUE, | 297 'not null' => TRUE, |
298 'default' => ''), | 298 'default' => ''), |
299 'min_word_count' => array( | 299 'min_word_count' => array( |
300 'description' => t('The minimum number of words the body must contain.'), | 300 'description' => 'The minimum number of words the body must contain.', |
301 'type' => 'int', | 301 'type' => 'int', |
302 'unsigned' => TRUE, | 302 'unsigned' => TRUE, |
303 'not null' => TRUE, | 303 'not null' => TRUE, |
304 'size' => 'small'), | 304 'size' => 'small'), |
305 'custom' => array( | 305 'custom' => array( |
306 '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).'), | 306 'description' => '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).', |
307 'type' => 'int', | 307 'type' => 'int', |
308 'not null' => TRUE, | 308 'not null' => TRUE, |
309 'default' => 0, | 309 'default' => 0, |
310 'size' => 'tiny'), | 310 'size' => 'tiny'), |
311 'modified' => array( | 311 'modified' => array( |
312 'description' => t('A boolean indicating whether this type has been modified by an administrator; currently not used in any way.'), | 312 'description' => 'A boolean indicating whether this type has been modified by an administrator; currently not used in any way.', |
313 'type' => 'int', | 313 'type' => 'int', |
314 'not null' => TRUE, | 314 'not null' => TRUE, |
315 'default' => 0, | 315 'default' => 0, |
316 'size' => 'tiny'), | 316 'size' => 'tiny'), |
317 'locked' => array( | 317 'locked' => array( |
318 'description' => t('A boolean indicating whether the administrator can change the machine name of this type.'), | 318 'description' => 'A boolean indicating whether the administrator can change the machine name of this type.', |
319 'type' => 'int', | 319 'type' => 'int', |
320 'not null' => TRUE, | 320 'not null' => TRUE, |
321 'default' => 0, | 321 'default' => 0, |
322 'size' => 'tiny'), | 322 'size' => 'tiny'), |
323 'orig_type' => array( | 323 'orig_type' => array( |
324 '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.'), | 324 'description' => 'The original machine-readable name of this node type. This may be different from the current type name if the locked field is 0.', |
325 'type' => 'varchar', | 325 'type' => 'varchar', |
326 'length' => 255, | 326 'length' => 255, |
327 'not null' => TRUE, | 327 'not null' => TRUE, |
328 'default' => '') | 328 'default' => '') |
329 ), | 329 ), |