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 $
5
5
* Implementation of hook_schema().
7
7
function node_schema() {
8
8
$schema['node'] = array(
9
'description' => t('The base table for nodes.'),
9
'description' => 'The base table for nodes.',
12
'description' => t('The primary identifier for a node.'),
12
'description' => 'The primary identifier for a node.',
13
13
'type' => 'serial',
14
14
'unsigned' => TRUE,
15
15
'not null' => TRUE),
17
'description' => t('The current {node_revisions}.vid version identifier.'),
17
'description' => 'The current {node_revisions}.vid version identifier.',
19
19
'unsigned' => TRUE,
20
20
'not null' => TRUE,
23
'description' => t('The {node_type}.type of this node.'),
23
'description' => 'The {node_type}.type of this node.',
24
24
'type' => 'varchar',
26
26
'not null' => TRUE,
28
28
'language' => array(
29
'description' => t('The {languages}.language of this node.'),
29
'description' => 'The {languages}.language of this node.',
30
30
'type' => 'varchar',
32
32
'not null' => TRUE,
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
36
'type' => 'varchar',
38
38
'not null' => TRUE,
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.',
43
43
'not null' => TRUE,
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).',
48
48
'not null' => TRUE,
50
50
'created' => array(
51
'description' => t('The Unix timestamp when the node was created.'),
51
'description' => 'The Unix timestamp when the node was created.',
53
53
'not null' => TRUE,
55
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.',
58
58
'not null' => TRUE,
60
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.',
63
63
'not null' => TRUE,
65
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.',
68
68
'not null' => TRUE,
70
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.',
73
73
'not null' => TRUE,
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.',
78
78
'not null' => TRUE,
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.',
83
83
'unsigned' => TRUE,
84
84
'not null' => TRUE,
86
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.',
89
89
'not null' => TRUE,
110
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
112
'fields' => array(
114
'description' => t('The {node}.nid this record affects.'),
114
'description' => 'The {node}.nid this record affects.',
116
116
'unsigned' => TRUE,
117
117
'not null' => TRUE,
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.",
122
122
'unsigned' => TRUE,
123
123
'not null' => TRUE,
125
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
127
'type' => 'varchar',
129
129
'not null' => TRUE,
130
130
'default' => ''),
131
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.',
134
134
'unsigned' => TRUE,
135
135
'not null' => TRUE,
137
137
'size' => 'tiny'),
138
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.',
141
141
'unsigned' => TRUE,
142
142
'not null' => TRUE,
144
144
'size' => 'tiny'),
145
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.',
148
148
'unsigned' => TRUE,
149
149
'not null' => TRUE,
156
156
$schema['node_counter'] = array(
157
'description' => t('Access statistics for {node}s.'),
157
'description' => 'Access statistics for {node}s.',
158
158
'fields' => array(
160
'description' => t('The {node}.nid for these statistics.'),
160
'description' => 'The {node}.nid for these statistics.',
162
162
'not null' => TRUE,
164
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.',
167
167
'unsigned' => TRUE,
168
168
'not null' => TRUE,
170
170
'size' => 'big'),
171
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.',
174
174
'unsigned' => TRUE,
175
175
'not null' => TRUE,
177
177
'size' => 'medium'),
178
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.',
181
181
'unsigned' => TRUE,
182
182
'not null' => TRUE,
188
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
190
'fields' => array(
192
'description' => t('The {node} this version belongs to.'),
192
'description' => 'The {node} this version belongs to.',
194
194
'unsigned' => TRUE,
195
195
'not null' => TRUE,
198
'description' => t('The primary identifier for this version.'),
198
'description' => 'The primary identifier for this version.',
199
199
'type' => 'serial',
200
200
'unsigned' => TRUE,
201
201
'not null' => TRUE),
203
'description' => t('The {users}.uid that created this version.'),
203
'description' => 'The {users}.uid that created this version.',
205
205
'not null' => TRUE,
207
207
'title' => array(
208
'description' => t('The title of this version.'),
208
'description' => 'The title of this version.',
209
209
'type' => 'varchar',
211
211
'not null' => TRUE,
212
212
'default' => ''),
214
'description' => t('The body of this version.'),
214
'description' => 'The body of this version.',
215
215
'type' => 'text',
216
216
'not null' => TRUE,
217
217
'size' => 'big'),
218
218
'teaser' => array(
219
'description' => t('The teaser of this version.'),
219
'description' => 'The teaser of this version.',
220
220
'type' => 'text',
221
221
'not null' => TRUE,
222
222
'size' => 'big'),
224
'description' => t('The log entry explaining the changes in this version.'),
224
'description' => 'The log entry explaining the changes in this version.',
225
225
'type' => 'text',
226
226
'not null' => TRUE,
227
227
'size' => 'big'),
228
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.',
231
231
'not null' => TRUE,
233
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.",
236
236
'not null' => TRUE,
246
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
248
'fields' => array(
250
'description' => t('The machine-readable name of this type.'),
250
'description' => 'The machine-readable name of this type.',
251
251
'type' => 'varchar',
253
253
'not null' => TRUE),
255
'description' => t('The human-readable name of this type.'),
255
'description' => 'The human-readable name of this type.',
256
256
'type' => 'varchar',
258
258
'not null' => TRUE,
259
259
'default' => ''),
260
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
262
'type' => 'varchar',
264
264
'not null' => TRUE),
265
265
'description' => array(
266
'description' => t('A brief description of this type.'),
266
'description' => 'A brief description of this type.',
267
267
'type' => 'text',
268
268
'not null' => TRUE,
269
269
'size' => 'medium'),
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
272
'type' => 'text',
273
273
'not null' => TRUE,
274
274
'size' => 'medium'),
275
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.',
278
278
'unsigned' => TRUE,
279
279
'not null' => TRUE,
280
280
'size' => 'tiny'),
281
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
283
'type' => 'varchar',
285
285
'not null' => TRUE,
286
286
'default' => ''),
287
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.',
290
290
'unsigned' => TRUE,
291
291
'not null' => TRUE,
292
292
'size' => 'tiny'),
293
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
295
'type' => 'varchar',
297
297
'not null' => TRUE,
298
298
'default' => ''),
299
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.',
302
302
'unsigned' => TRUE,
303
303
'not null' => TRUE,
304
304
'size' => 'small'),
305
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).',
308
308
'not null' => TRUE,
310
310
'size' => 'tiny'),
311
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.',
314
314
'not null' => TRUE,
316
316
'size' => 'tiny'),
317
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.',
320
320
'not null' => TRUE,
322
322
'size' => 'tiny'),
323
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
325
'type' => 'varchar',
327
327
'not null' => TRUE,