2
// $Id: user.install,v 1.5 2008/01/08 07:46:41 goba Exp $
2
// $Id: user.install,v 1.5.2.1 2009/01/06 15:46:38 goba Exp $
5
5
* Implementation of hook_schema().
7
7
function user_schema() {
8
8
$schema['access'] = array(
9
'description' => t('Stores site access rules.'),
9
'description' => 'Stores site access rules.',
12
12
'type' => 'serial',
13
13
'not null' => TRUE,
14
'description' => t('Primary Key: Unique access ID.'),
14
'description' => 'Primary Key: Unique access ID.',
17
17
'type' => 'varchar',
19
19
'not null' => TRUE,
21
'description' => t('Text mask used for filtering access.'),
21
'description' => 'Text mask used for filtering access.',
24
24
'type' => 'varchar',
26
26
'not null' => TRUE,
28
'description' => t('Type of access rule: name, mail or host.'),
28
'description' => 'Type of access rule: name, mail or host.',
32
32
'not null' => TRUE,
35
'description' => t('Whether rule is to allow(1) or deny(0) access.'),
35
'description' => 'Whether rule is to allow(1) or deny(0) access.',
38
38
'primary key' => array('aid'),
41
41
$schema['authmap'] = array(
42
'description' => t('Stores distributed authentication mapping.'),
42
'description' => 'Stores distributed authentication mapping.',
45
'description' => t('Primary Key: Unique authmap ID.'),
45
'description' => 'Primary Key: Unique authmap ID.',
46
46
'type' => 'serial',
47
47
'unsigned' => TRUE,
48
48
'not null' => TRUE,
52
52
'not null' => TRUE,
54
'description' => t("User's {users}.uid."),
54
'description' => "User's {users}.uid.",
56
56
'authname' => array(
57
57
'type' => 'varchar',
59
59
'not null' => TRUE,
61
'description' => t('Unique authentication name.'),
61
'description' => 'Unique authentication name.',
64
64
'type' => 'varchar',
66
66
'not null' => TRUE,
68
'description' => t('Module which is controlling the authentication.'),
68
'description' => 'Module which is controlling the authentication.',
71
71
'unique keys' => array('authname' => array('authname')),
75
75
$schema['permission'] = array(
76
'description' => t('Stores permissions for users.'),
76
'description' => 'Stores permissions for users.',
79
79
'type' => 'serial',
80
80
'not null' => TRUE,
81
'description' => t('Primary Key: Unique permission ID.'),
81
'description' => 'Primary Key: Unique permission ID.',
85
85
'unsigned' => TRUE,
86
86
'not null' => TRUE,
88
'description' => t('The {role}.rid to which the permissions are assigned.'),
88
'description' => 'The {role}.rid to which the permissions are assigned.',
92
92
'not null' => FALSE,
94
'description' => t('List of permissions being assigned.'),
94
'description' => 'List of permissions being assigned.',
98
98
'unsigned' => TRUE,
99
99
'not null' => TRUE,
101
'description' => t('Originally intended for taxonomy-based permissions, but never used.'),
101
'description' => 'Originally intended for taxonomy-based permissions, but never used.',
104
104
'primary key' => array('pid'),
108
108
$schema['role'] = array(
109
'description' => t('Stores user roles.'),
109
'description' => 'Stores user roles.',
110
110
'fields' => array(
112
112
'type' => 'serial',
113
113
'unsigned' => TRUE,
114
114
'not null' => TRUE,
115
'description' => t('Primary Key: Unique role id.'),
115
'description' => 'Primary Key: Unique role id.',
118
118
'type' => 'varchar',
120
120
'not null' => TRUE,
122
'description' => t('Unique role name.'),
122
'description' => 'Unique role name.',
125
125
'unique keys' => array('name' => array('name')),
129
129
$schema['users'] = array(
130
'description' => t('Stores user data.'),
130
'description' => 'Stores user data.',
131
131
'fields' => array(
133
133
'type' => 'serial',
134
134
'unsigned' => TRUE,
135
135
'not null' => TRUE,
136
'description' => t('Primary Key: Unique user ID.'),
136
'description' => 'Primary Key: Unique user ID.',
139
139
'type' => 'varchar',
141
141
'not null' => TRUE,
143
'description' => t('Unique user name.'),
143
'description' => 'Unique user name.',
146
146
'type' => 'varchar',
148
148
'not null' => TRUE,
150
'description' => t("User's password (md5 hash)."),
150
'description' => "User's password (md5 hash).",
153
153
'type' => 'varchar',
155
155
'not null' => FALSE,
157
'description' => t("User's email address."),
157
'description' => "User's email address.",
161
161
'not null' => TRUE,
163
163
'size' => 'tiny',
164
'description' => t('Per-user comment display mode (threaded vs. flat), used by the {comment} module.'),
164
'description' => 'Per-user comment display mode (threaded vs. flat), used by the {comment} module.',
168
168
'not null' => FALSE,
170
170
'size' => 'tiny',
171
'description' => t('Per-user comment sort order (newest vs. oldest first), used by the {comment} module.'),
171
'description' => 'Per-user comment sort order (newest vs. oldest first), used by the {comment} module.',
173
173
'threshold' => array(
175
175
'not null' => FALSE,
177
177
'size' => 'tiny',
178
'description' => t('Previously used by the {comment} module for per-user preferences; no longer used.'),
178
'description' => 'Previously used by the {comment} module for per-user preferences; no longer used.',
180
180
'theme' => array(
181
181
'type' => 'varchar',
183
183
'not null' => TRUE,
185
'description' => t("User's default theme."),
185
'description' => "User's default theme.",
187
187
'signature' => array(
188
188
'type' => 'varchar',
190
190
'not null' => TRUE,
192
'description' => t("User's signature."),
192
'description' => "User's signature.",
194
194
'created' => array(
196
196
'not null' => TRUE,
198
'description' => t('Timestamp for when user was created.'),
198
'description' => 'Timestamp for when user was created.',
200
200
'access' => array(
202
202
'not null' => TRUE,
204
'description' => t('Timestamp for previous time user accessed the site.'),
204
'description' => 'Timestamp for previous time user accessed the site.',
206
206
'login' => array(
208
208
'not null' => TRUE,
210
'description' => t("Timestamp for user's last login."),
210
'description' => "Timestamp for user's last login.",
212
212
'status' => array(
214
214
'not null' => TRUE,
216
216
'size' => 'tiny',
217
'description' => t('Whether the user is active(1) or blocked(0).'),
217
'description' => 'Whether the user is active(1) or blocked(0).',
219
219
'timezone' => array(
220
220
'type' => 'varchar',
222
222
'not null' => FALSE,
223
'description' => t("User's timezone."),
223
'description' => "User's timezone.",
225
225
'language' => array(
226
226
'type' => 'varchar',
228
228
'not null' => TRUE,
230
'description' => t("User's default language."),
230
'description' => "User's default language.",
232
232
'picture' => array(
233
233
'type' => 'varchar',
235
235
'not null' => TRUE,
237
'description' => t("Path to the user's uploaded picture."),
237
'description' => "Path to the user's uploaded picture.",
240
240
'type' => 'varchar',
242
242
'not null' => FALSE,
244
'description' => t('Email address used for initial account creation.'),
244
'description' => 'Email address used for initial account creation.',
247
247
'type' => 'text',
248
248
'not null' => FALSE,
250
'description' => t('A serialized array of name value pairs that are related to the user. Any form values posted during user edit are stored and are loaded into the $user object during user_load(). Use of this field is discouraged and it will likely disappear in a future version of Drupal.'),
250
'description' => 'A serialized array of name value pairs that are related to the user. Any form values posted during user edit are stored and are loaded into the $user object during user_load(). Use of this field is discouraged and it will likely disappear in a future version of Drupal.',
253
253
'indexes' => array(
264
264
$schema['users_roles'] = array(
265
'description' => t('Maps users to roles.'),
265
'description' => 'Maps users to roles.',
266
266
'fields' => array(
269
269
'unsigned' => TRUE,
270
270
'not null' => TRUE,
272
'description' => t('Primary Key: {users}.uid for user.'),
272
'description' => 'Primary Key: {users}.uid for user.',
276
276
'unsigned' => TRUE,
277
277
'not null' => TRUE,
279
'description' => t('Primary Key: {role}.rid for role.'),
279
'description' => 'Primary Key: {role}.rid for role.',
282
282
'primary key' => array('uid', 'rid'),