1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
{
"comment": "Add user_is_temp to user table",
"before": {
"name": "user",
"comment": "The user table contains basic account information, authentication keys, etc. Some multi-wiki sites may share a single central user table between separate wikis using the $wgSharedDB setting. Note that even when an external authentication plugin is in use, user table entries still need to be created to store preferences and to key tracking information in the other tables",
"columns": [
{
"name": "user_id",
"type": "integer",
"options": { "unsigned": true, "notnull": true, "autoincrement": true }
},
{
"name": "user_name",
"comment": "Usernames must be unique, must not be in the form of an IP address. They should not allow slashes or case conflicts. Spaces are allowed, and are not converted to underscores like in page titles.",
"type": "binary",
"options": { "notnull": true, "length": 255, "default": "" }
},
{
"name": "user_real_name",
"comment": "Optional 'real name' to be displayed in credit listings",
"type": "binary",
"options": { "notnull": true, "length": 255, "default": "" }
},
{
"name": "user_password",
"comment": "Password hashes",
"type": "blob",
"options": { "notnull": true, "length": 255 }
},
{
"name": "user_newpassword",
"comment": "When using 'mail me a new password', a random password is generated and the hash stored here. The previous password is left in place until someone actually logs in with the new password, at which point the hash is moved to user_password and the old password is invalidated.",
"type": "blob",
"options": { "notnull": true, "length": 255 }
},
{
"name": "user_newpass_time",
"comment": "Timestamp of the last time when a new password was sent, for throttling and expiring purposes. Emailed passwords will expire $wgNewPasswordExpiry (a week) after being set. If user_newpass_time is NULL (eg. created by mail) it doesn't expire.",
"type": "mwtimestamp",
"options": { "notnull": false }
},
{
"name": "user_email",
"comment": "User email. Non public info.",
"type": "text",
"options": { "notnull": true, "length": 255 }
},
{
"name": "user_touched",
"comment": "If the browser sends an If-Modified-Since header, a 304 response is suppressed if the value in this field for the current user is later than the value in the IMS header. That is, this field is an invalidation timestamp for the browser cache of logged-in users. Among other things, it is used to prevent pages generated for a previously logged in user from being displayed after a session expiry followed by a fresh login.",
"type": "mwtimestamp",
"options": { "notnull": true }
},
{
"name": "user_token",
"comment": "A pseudorandomly generated value that is stored in a cookie when the 'remember password' feature is used (previously, a hash of the password was used, but this was vulnerable to cookie-stealing attacks)",
"type": "binary",
"options": { "notnull": true, "default": "", "length": 32, "fixed": true }
},
{
"name": "user_email_authenticated",
"comment": "Initially NULL; when a user's e-mail address has been validated by returning with a mailed token, this is set to the current timestamp.",
"type": "mwtimestamp",
"options": { "notnull": false }
},
{
"name": "user_email_token",
"comment": "Randomly generated token created when the e-mail address is set and a confirmation test mail sent.",
"type": "binary",
"options": { "notnull": false, "length": 32, "fixed": true }
},
{
"name": "user_email_token_expires",
"comment": "Expiration date for the user_email_token.",
"type": "mwtimestamp",
"options": { "notnull": false }
},
{
"name": "user_registration",
"comment": "Timestamp of account registration. Accounts predating this schema addition may contain NULL.",
"type": "mwtimestamp",
"options": { "notnull": false }
},
{
"name": "user_editcount",
"comment": "Count of edits and edit-like actions. Not intended to be an accurate copy of 'COUNT(*) WHERE rev_actor refers to a user's actor_id'. May contain NULL for old accounts if batch-update scripts haven't been run, as well as listing deleted edits and other myriad ways it could be out of sync. Meant primarily for heuristic checks to give an impression of whether the account has been used much.",
"type": "integer",
"options": { "notnull": false, "unsigned": true }
},
{
"name": "user_password_expires",
"comment": "Expiration date for user password.",
"type": "mwtimestamp",
"options": {
"notnull": false,
"CustomSchemaOptions": {
"allowInfinite": true
}
}
}
],
"indexes": [
{ "name": "user_name", "columns": [ "user_name" ], "unique": true },
{ "name": "user_email_token", "columns": [ "user_email_token" ], "unique": false },
{ "name": "user_email", "columns": [ "user_email" ], "unique": false, "options": { "lengths": [ 50, null, null ] } }
],
"pk": [ "user_id" ]
},
"after": {
"name": "user",
"comment": "The user table contains basic account information, authentication keys, etc. Some multi-wiki sites may share a single central user table between separate wikis using the $wgSharedDB setting. Note that even when an external authentication plugin is in use, user table entries still need to be created to store preferences and to key tracking information in the other tables",
"columns": [
{
"name": "user_id",
"type": "integer",
"options": { "unsigned": true, "notnull": true, "autoincrement": true }
},
{
"name": "user_name",
"comment": "Usernames must be unique, must not be in the form of an IP address. They should not allow slashes or case conflicts. Spaces are allowed, and are not converted to underscores like in page titles.",
"type": "binary",
"options": { "notnull": true, "length": 255, "default": "" }
},
{
"name": "user_real_name",
"comment": "Optional 'real name' to be displayed in credit listings",
"type": "binary",
"options": { "notnull": true, "length": 255, "default": "" }
},
{
"name": "user_password",
"comment": "Password hashes",
"type": "blob",
"options": { "notnull": true, "length": 255 }
},
{
"name": "user_newpassword",
"comment": "When using 'mail me a new password', a random password is generated and the hash stored here. The previous password is left in place until someone actually logs in with the new password, at which point the hash is moved to user_password and the old password is invalidated.",
"type": "blob",
"options": { "notnull": true, "length": 255 }
},
{
"name": "user_newpass_time",
"comment": "Timestamp of the last time when a new password was sent, for throttling and expiring purposes. Emailed passwords will expire $wgNewPasswordExpiry (a week) after being set. If user_newpass_time is NULL (eg. created by mail) it doesn't expire.",
"type": "mwtimestamp",
"options": { "notnull": false }
},
{
"name": "user_email",
"comment": "User email. Non public info.",
"type": "text",
"options": { "notnull": true, "length": 255 }
},
{
"name": "user_touched",
"comment": "If the browser sends an If-Modified-Since header, a 304 response is suppressed if the value in this field for the current user is later than the value in the IMS header. That is, this field is an invalidation timestamp for the browser cache of logged-in users. Among other things, it is used to prevent pages generated for a previously logged in user from being displayed after a session expiry followed by a fresh login.",
"type": "mwtimestamp",
"options": { "notnull": true }
},
{
"name": "user_token",
"comment": "A pseudorandomly generated value that is stored in a cookie when the 'remember password' feature is used (previously, a hash of the password was used, but this was vulnerable to cookie-stealing attacks)",
"type": "binary",
"options": { "notnull": true, "default": "", "length": 32, "fixed": true }
},
{
"name": "user_email_authenticated",
"comment": "Initially NULL; when a user's e-mail address has been validated by returning with a mailed token, this is set to the current timestamp.",
"type": "mwtimestamp",
"options": { "notnull": false }
},
{
"name": "user_email_token",
"comment": "Randomly generated token created when the e-mail address is set and a confirmation test mail sent.",
"type": "binary",
"options": { "notnull": false, "length": 32, "fixed": true }
},
{
"name": "user_email_token_expires",
"comment": "Expiration date for the user_email_token.",
"type": "mwtimestamp",
"options": { "notnull": false }
},
{
"name": "user_registration",
"comment": "Timestamp of account registration. Accounts predating this schema addition may contain NULL.",
"type": "mwtimestamp",
"options": { "notnull": false }
},
{
"name": "user_editcount",
"comment": "Count of edits and edit-like actions. Not intended to be an accurate copy of 'COUNT(*) WHERE rev_actor refers to a user's actor_id'. May contain NULL for old accounts if batch-update scripts haven't been run, as well as listing deleted edits and other myriad ways it could be out of sync. Meant primarily for heuristic checks to give an impression of whether the account has been used much.",
"type": "integer",
"options": { "notnull": false, "unsigned": true }
},
{
"name": "user_password_expires",
"comment": "Expiration date for user password.",
"type": "mwtimestamp",
"options": {
"notnull": false,
"CustomSchemaOptions": {
"allowInfinite": true
}
}
},
{
"name": "user_is_temp",
"comment": "A boolean value representing whether the user is a temporary user. False if any type of user other than a temporary user. This exists to allow temporary users to be identified from the database only, by external applications.",
"type": "mwtinyint",
"options": {
"notnull": true,
"length": 1,
"default": 0
}
}
],
"indexes": [
{ "name": "user_name", "columns": [ "user_name" ], "unique": true },
{ "name": "user_email_token", "columns": [ "user_email_token" ], "unique": false },
{ "name": "user_email", "columns": [ "user_email" ], "unique": false, "options": { "lengths": [ 50, null, null ] } }
],
"pk": [ "user_id" ]
}
}
|