Index: branches/new-installer/phase3/maintenance/language/messages.inc |
— | — | @@ -3354,8 +3354,8 @@ |
3355 | 3355 | 'config-stage-done', |
3356 | 3356 | 'config-install-extensions', |
3357 | 3357 | 'config-install-database', |
3358 | | - 'config-install-schema', |
3359 | 3358 | 'config-install-tables', |
| 3359 | + 'config-install-interwiki-sql', |
3360 | 3360 | 'config-install-secretkey', |
3361 | 3361 | 'config-insecure-secretkey', |
3362 | 3362 | 'config-install-user', |
Index: branches/new-installer/phase3/includes/db/Schema.php |
— | — | @@ -1,2231 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * Schema.php - Abstracted database schema for MediaWiki |
5 | | - * |
6 | | - * This program is free software; you can redistribute it and/or modify |
7 | | - * it under the terms of the GNU General Public License as published by |
8 | | - * the Free Software Foundation; either version 2 of the License, or |
9 | | - * (at your option) any later version. |
10 | | - * |
11 | | - * This program is distributed in the hope that it will be useful, |
12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | | - * GNU General Public License for more details. |
15 | | - * |
16 | | - * You should have received a copy of the GNU General Public License |
17 | | - * along with this program; if not, write to the Free Software |
18 | | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
19 | | - * |
20 | | - * @author Chad Horohoe <chad@anyonecanedit.org> |
21 | | - * @todo FOLLOWING TABLES NEED WORK: |
22 | | - * -externallinks, ipblocks, oldimage, job (indexes) |
23 | | - * -trackbacks, testitem (REFERENCES) |
24 | | - */ |
25 | | -class Schema { |
26 | | - /** |
27 | | - * Field types |
28 | | - */ |
29 | | - public static $dataTypes = array( 'int', 'varchar', 'datetime', 'text', 'blob', |
30 | | - 'binary', 'varbinary', 'bool', 'enum', 'float', 'real', 'char', 'none' ); |
31 | | - |
32 | | - /** |
33 | | - * The actual database definition itself. A multi-dimensional associative |
34 | | - * array containing the tables and rows. The top-level keys are the table |
35 | | - * names (without prefixes). The value for this is a 3-tuple: |
36 | | - * 1) prefix - being the prefix for all the columns in the table |
37 | | - * (eg: "cl" for categorylinks) |
38 | | - * 2) columns - an array of column name => definition, where definition is |
39 | | - * an associative array of properties and their values |
40 | | - * 3) indexes - an array of index name => array of columns to index |
41 | | - * |
42 | | - */ |
43 | | - public static $defaultTables = array( |
44 | | - 'user' => array( |
45 | | - 'prefix' => 'user', |
46 | | - 'fields' => array( |
47 | | - 'id' => array( |
48 | | - 'type' => 'int', |
49 | | - 'null' => false, |
50 | | - 'auto-increment' => true, |
51 | | - 'primary-key' => true, |
52 | | - 'signed' => false, |
53 | | - ), |
54 | | - 'name' => array( |
55 | | - 'type' => 'varchar', |
56 | | - 'length' => 255, |
57 | | - 'null' => false, |
58 | | - 'binary' => true, |
59 | | - 'default' => '', |
60 | | - ), |
61 | | - 'real_name' => array( |
62 | | - 'type' => 'varchar', |
63 | | - 'length' => 255, |
64 | | - 'null' => false, |
65 | | - 'binary' => true, |
66 | | - 'default' => '', |
67 | | - ), |
68 | | - 'password' => array( |
69 | | - 'type' => 'blob', |
70 | | - 'length' => 'tiny', |
71 | | - 'null' => false, |
72 | | - ), |
73 | | - 'new_password' => array( |
74 | | - 'type' => 'blob', |
75 | | - 'length' => 'tiny', |
76 | | - 'null' => false, |
77 | | - ), |
78 | | - 'newpass_time' => array( |
79 | | - 'type' => 'datetime', |
80 | | - ), |
81 | | - 'email' => array( |
82 | | - 'type' => 'text', |
83 | | - 'length' => 'tiny', |
84 | | - 'null' => false, |
85 | | - ), |
86 | | - 'options' => array( |
87 | | - 'type' => 'blob', |
88 | | - 'null' => false, |
89 | | - ), |
90 | | - 'touched' => array( |
91 | | - 'type' => 'datetime', |
92 | | - 'null' => false, |
93 | | - 'default' => '', |
94 | | - ), |
95 | | - 'token' => array( |
96 | | - 'type' => 'binary', |
97 | | - 'length' => 32, |
98 | | - 'null' => false, |
99 | | - 'default' => '', |
100 | | - ), |
101 | | - 'email_authenticated' => array( |
102 | | - 'type' => 'datetime', |
103 | | - ), |
104 | | - 'email_token' => array( |
105 | | - 'type' => 'binary', |
106 | | - 'length' => 32, |
107 | | - ), |
108 | | - 'email_token_expires' => array( |
109 | | - 'type' => 'datetime', |
110 | | - ), |
111 | | - 'registration' => array( |
112 | | - 'type' => 'datetime', |
113 | | - ), |
114 | | - 'editcount' => array( |
115 | | - 'type' => 'int', |
116 | | - ), |
117 | | - ), |
118 | | - 'indexes' => array( |
119 | | - 'user_name' => array( |
120 | | - 'UNIQUE', 'name', |
121 | | - ), |
122 | | - 'user_email_token' => array( |
123 | | - 'email_token', |
124 | | - ), |
125 | | - ) |
126 | | - ), |
127 | | - 'user_groups' => array( |
128 | | - 'prefix' => 'ug', |
129 | | - 'fields' => array( |
130 | | - 'user' => array( |
131 | | - 'type' => 'int', |
132 | | - 'null' => false, |
133 | | - 'primary-key' => true, |
134 | | - 'default' => 0, |
135 | | - 'signed' => false, |
136 | | - ), |
137 | | - 'group' => array( |
138 | | - 'type' => 'varbinary', |
139 | | - 'length' => 16, |
140 | | - 'null' => false, |
141 | | - 'default' => '', |
142 | | - ), |
143 | | - ), |
144 | | - 'indexes' => array( |
145 | | - 'ug_user_group' => array( |
146 | | - 'UNIQUE', 'user', 'group', |
147 | | - ), |
148 | | - 'ug_group' => array( |
149 | | - 'group', |
150 | | - ), |
151 | | - ), |
152 | | - ), |
153 | | - 'user_newtalk' => array( |
154 | | - 'prefix' => 'user', |
155 | | - 'fields' => array( |
156 | | - 'id' => array( |
157 | | - 'type' => 'int', |
158 | | - 'null' => false, |
159 | | - 'default' => 0, |
160 | | - ), |
161 | | - 'ip' => array( |
162 | | - 'type' => 'varbinary', |
163 | | - 'null' => false, |
164 | | - 'length' => 40, |
165 | | - 'default' => '', |
166 | | - ), |
167 | | - 'last_timestamp' => array( |
168 | | - 'type' => 'datetime', |
169 | | - 'null' => false, |
170 | | - 'default' => '', |
171 | | - ), |
172 | | - ), |
173 | | - 'indexes' => array( |
174 | | - 'un_user_id' => array( |
175 | | - 'id', |
176 | | - ), |
177 | | - 'un_user_ip' => array( |
178 | | - 'ip', |
179 | | - ), |
180 | | - ) |
181 | | - ), |
182 | | - 'user_properties' => array( |
183 | | - 'prefix' => 'up', |
184 | | - 'fields' => array( |
185 | | - 'user' => array( |
186 | | - 'type' => 'int', |
187 | | - 'null' => false, |
188 | | - ), |
189 | | - 'property' => array( |
190 | | - 'type' => 'varbinary', |
191 | | - 'null' => false, |
192 | | - 'length' => 32, |
193 | | - ), |
194 | | - 'value' => array( |
195 | | - 'type' => 'blob', |
196 | | - ), |
197 | | - ), |
198 | | - 'indexes' => array( |
199 | | - 'user_properties_user_property' => array( |
200 | | - 'UNIQUE', 'user', 'property', |
201 | | - ), |
202 | | - 'user_properties_property' => array( |
203 | | - 'property', |
204 | | - ), |
205 | | - ), |
206 | | - ), |
207 | | - 'page' => array( |
208 | | - 'prefix' => 'page', |
209 | | - 'fields' => array( |
210 | | - 'id' => array( |
211 | | - 'type' => 'int', |
212 | | - 'null' => false, |
213 | | - 'auto-increment' => true, |
214 | | - 'primary-key' => true, |
215 | | - 'signed' => false, |
216 | | - ), |
217 | | - 'namespace' => array( |
218 | | - 'type' => 'int', |
219 | | - 'null' => false, |
220 | | - ), |
221 | | - 'title' => array( |
222 | | - 'type' => 'varchar', |
223 | | - 'length' => 255, |
224 | | - 'binary' => true, |
225 | | - 'null' => false, |
226 | | - ), |
227 | | - 'restrictions' => array( |
228 | | - 'type' => 'blob', |
229 | | - 'length' => 'tiny', |
230 | | - 'null' => false, |
231 | | - ), |
232 | | - 'counter' => array( |
233 | | - 'type' => 'int', |
234 | | - 'length' => 'big', |
235 | | - 'null' => false, |
236 | | - 'default' => 0, |
237 | | - 'signed' => false, |
238 | | - ), |
239 | | - 'is_redirect' => array( |
240 | | - 'type' => 'int', |
241 | | - 'length' => 'tiny', |
242 | | - 'null' => false, |
243 | | - 'default' => 0, |
244 | | - 'signed' => false, |
245 | | - ), |
246 | | - 'is_new' => array( |
247 | | - 'type' => 'int', |
248 | | - 'length' => 'tiny', |
249 | | - 'null' => false, |
250 | | - 'default' => 0, |
251 | | - 'signed' => false, |
252 | | - ), |
253 | | - 'random' => array( |
254 | | - 'type' => 'real', |
255 | | - 'signed' => false, |
256 | | - 'null' => false, |
257 | | - ), |
258 | | - 'touched' => array( |
259 | | - 'type' => 'datetime', |
260 | | - 'null' => false, |
261 | | - 'default' => '', |
262 | | - ), |
263 | | - 'latest' => array( |
264 | | - 'type' => 'int', |
265 | | - 'null' => false, |
266 | | - 'signed' => false, |
267 | | - ), |
268 | | - 'len' => array( |
269 | | - 'type' => 'int', |
270 | | - 'null' => false, |
271 | | - 'signed' => false, |
272 | | - ), |
273 | | - ), |
274 | | - 'indexes' => array( |
275 | | - 'name_title' => array( |
276 | | - 'UNIQUE', 'namespace', 'title', |
277 | | - ), |
278 | | - 'page_random' => array( |
279 | | - 'random', |
280 | | - ), |
281 | | - 'page_len' => array( |
282 | | - 'len', |
283 | | - ), |
284 | | - ), |
285 | | - ), |
286 | | - 'revision' => array( |
287 | | - 'prefix' => 'rev', |
288 | | - 'fields' => array( |
289 | | - 'id' => array( |
290 | | - 'type' => 'int', |
291 | | - 'null' => false, |
292 | | - 'auto-increment' => true, |
293 | | - 'primary-key' => true, |
294 | | - 'signed' => false, |
295 | | - ), |
296 | | - 'page' => array( |
297 | | - 'type' => 'int', |
298 | | - 'null' => false, |
299 | | - 'signed' => false, |
300 | | - ), |
301 | | - 'text_id' => array( |
302 | | - 'type' => 'int', |
303 | | - 'null' => false, |
304 | | - 'signed' => false, |
305 | | - ), |
306 | | - 'comment' => array( |
307 | | - 'type' => 'blob', |
308 | | - 'length' => 'tiny', |
309 | | - 'null' => false, |
310 | | - ), |
311 | | - 'user' => array( |
312 | | - 'type' => 'int', |
313 | | - 'null' => false, |
314 | | - 'default' => 0, |
315 | | - 'signed' => false, |
316 | | - ), |
317 | | - 'user_text' => array( |
318 | | - 'type' => 'varchar', |
319 | | - 'length' => 255, |
320 | | - 'binary' => true, |
321 | | - 'null' => false, |
322 | | - 'default' => '', |
323 | | - ), |
324 | | - 'timestamp' => array( |
325 | | - 'type' => 'datetime', |
326 | | - 'null' => false, |
327 | | - 'default' => '', |
328 | | - ), |
329 | | - 'minor_edit' => array( |
330 | | - 'type' => 'int', |
331 | | - 'length' => 'tiny', |
332 | | - 'null' => false, |
333 | | - 'default' => 0, |
334 | | - 'signed' => false, |
335 | | - ), |
336 | | - 'deleted' => array( |
337 | | - 'type' => 'int', |
338 | | - 'length' => 'tiny', |
339 | | - 'null' => false, |
340 | | - 'default' => 0, |
341 | | - 'signed' => false, |
342 | | - ), |
343 | | - 'len' => array( |
344 | | - 'type' => 'int', |
345 | | - 'default' => null, |
346 | | - 'signed' => false, |
347 | | - ), |
348 | | - ), |
349 | | - 'indexes' => array( |
350 | | - 'rev_page_id' => array( |
351 | | - 'UNIQUE', 'page','id', |
352 | | - ), |
353 | | - 'rev_timestamp' => array( |
354 | | - 'timestamp', |
355 | | - ), |
356 | | - 'page_timestamp' => array( |
357 | | - 'page', 'timestamp', |
358 | | - ), |
359 | | - 'user_timestamp' => array( |
360 | | - 'user', 'timestamp', |
361 | | - ), |
362 | | - 'usertext_timestamp' => array( |
363 | | - 'user_text', 'timestamp', |
364 | | - ), |
365 | | - ), |
366 | | - ), |
367 | | - 'text' => array( |
368 | | - 'prefix' => 'old', |
369 | | - 'fields' => array( |
370 | | - 'id' => array( |
371 | | - 'type' => 'int', |
372 | | - 'null' => false, |
373 | | - 'auto-increment' => true, |
374 | | - 'primary-key' => true, |
375 | | - 'signed' => false, |
376 | | - ), |
377 | | - 'text' => array( |
378 | | - 'type' => 'blob', |
379 | | - 'length' => 'medium', |
380 | | - 'null' => false, |
381 | | - ), |
382 | | - 'flags' => array( |
383 | | - 'type' => 'blob', |
384 | | - 'length' => 'tiny', |
385 | | - 'null' => false, |
386 | | - ), |
387 | | - ), |
388 | | - 'indexes' => array(), |
389 | | - ), |
390 | | - 'archive' => array( |
391 | | - 'prefix' => 'ar', |
392 | | - 'fields' => array( |
393 | | - 'namespace' => array( |
394 | | - 'type' => 'int', |
395 | | - 'null' => false, |
396 | | - 'default' => 0, |
397 | | - ), |
398 | | - 'title' => array( |
399 | | - 'type' => 'varchar', |
400 | | - 'length' => 255, |
401 | | - 'binary' => true, |
402 | | - 'null' => false, |
403 | | - 'default' => '', |
404 | | - ), |
405 | | - 'text' => array( |
406 | | - 'type' => 'blob', |
407 | | - 'length' => 'medium', |
408 | | - 'null' => false, |
409 | | - ), |
410 | | - 'comment' => array( |
411 | | - 'type' => 'blob', |
412 | | - 'length' => 'tiny', |
413 | | - 'null' => false, |
414 | | - ), |
415 | | - 'user' => array( |
416 | | - 'type' => 'int', |
417 | | - 'null' => false, |
418 | | - 'default' => 0, |
419 | | - 'signed' => false, |
420 | | - ), |
421 | | - 'user_text' => array( |
422 | | - 'type' => 'varchar', |
423 | | - 'length' => 255, |
424 | | - 'binary' => true, |
425 | | - 'null' => false, |
426 | | - ), |
427 | | - 'timestamp' => array( |
428 | | - 'type' => 'datetime', |
429 | | - 'null' => false, |
430 | | - 'default' => '', |
431 | | - ), |
432 | | - 'minor_edit' => array( |
433 | | - 'type' => 'int', |
434 | | - 'length' => 'tiny', |
435 | | - 'null' => false, |
436 | | - 'default' => 0, |
437 | | - ), |
438 | | - 'flags' => array( |
439 | | - 'type' => 'blob', |
440 | | - 'length' => 'tiny', |
441 | | - 'null' => false, |
442 | | - ), |
443 | | - 'rev_id' => array( |
444 | | - 'type' => 'int', |
445 | | - 'signed' => false, |
446 | | - ), |
447 | | - 'text_id' => array( |
448 | | - 'type' => 'int', |
449 | | - 'signed' => false, |
450 | | - ), |
451 | | - 'deleted' => array( |
452 | | - 'type' => 'int', |
453 | | - 'length' => 'tiny', |
454 | | - 'null' => false, |
455 | | - 'default' => 0, |
456 | | - 'signed' => false, |
457 | | - ), |
458 | | - 'len' => array( |
459 | | - 'type' => 'int', |
460 | | - 'signed' => false, |
461 | | - ), |
462 | | - 'page_id' => array( |
463 | | - 'type' => 'int', |
464 | | - 'signed' => false, |
465 | | - ), |
466 | | - 'parent_id' => array( |
467 | | - 'type' => 'int', |
468 | | - 'default' => null, |
469 | | - 'signed' => false, |
470 | | - ), |
471 | | - ), |
472 | | - 'indexes' => array( |
473 | | - 'name_title_timestamp' => array( |
474 | | - 'namespace', 'title', 'timestamp', |
475 | | - ), |
476 | | - 'ar_usertext_timestamp' => array( |
477 | | - 'user_text', 'timestamp', |
478 | | - ), |
479 | | - ), |
480 | | - ), |
481 | | - 'pagelinks' => array( |
482 | | - 'prefix' => 'pl', |
483 | | - 'fields' => array( |
484 | | - 'from' => array( |
485 | | - 'type' => 'int', |
486 | | - 'null' => false, |
487 | | - 'default' => 0, |
488 | | - 'signed' => false, |
489 | | - ), |
490 | | - 'namespace' => array( |
491 | | - 'type' => 'int', |
492 | | - 'null' => false, |
493 | | - 'default' => 0, |
494 | | - ), |
495 | | - 'title' => array( |
496 | | - 'type' => 'varchar', |
497 | | - 'length' => 255, |
498 | | - 'binary' => true, |
499 | | - 'null' => false, |
500 | | - 'default' => '', |
501 | | - ), |
502 | | - ), |
503 | | - 'indexes' => array( |
504 | | - 'pl_from' => array( |
505 | | - 'UNIQUE', 'from','namespace', 'title', |
506 | | - ), |
507 | | - 'pl_namespace' => array( |
508 | | - 'UNIQUE', 'namespace','title', 'from', |
509 | | - ), |
510 | | - ), |
511 | | - ), |
512 | | - 'templatelinks' => array( |
513 | | - 'prefix' => 'tl', |
514 | | - 'fields' => array( |
515 | | - 'from' => array( |
516 | | - 'type' => 'int', |
517 | | - 'null' => false, |
518 | | - 'default' => 0, |
519 | | - 'signed' => false, |
520 | | - ), |
521 | | - 'namespace' => array( |
522 | | - 'type' => 'int', |
523 | | - 'null' => false, |
524 | | - 'default' => 0, |
525 | | - ), |
526 | | - 'title' => array( |
527 | | - 'type' => 'varchar', |
528 | | - 'length' => 255, |
529 | | - 'binary' => true, |
530 | | - 'null' => false, |
531 | | - 'default' => '', |
532 | | - ), |
533 | | - ), |
534 | | - 'indexes' => array( |
535 | | - 'tl_from' => array( |
536 | | - 'UNIQUE', 'from','namespace', 'title', |
537 | | - ), |
538 | | - 'tl_namespace' => array( |
539 | | - 'UNIQUE', 'namespace','title', 'from', |
540 | | - ), |
541 | | - ), |
542 | | - ), |
543 | | - 'imagelinks' => array( |
544 | | - 'prefix' => 'il', |
545 | | - 'fields' => array( |
546 | | - 'from' => array( |
547 | | - 'type' => 'int', |
548 | | - 'null' => false, |
549 | | - 'default' => 0, |
550 | | - 'signed' => false, |
551 | | - ), |
552 | | - 'to' => array( |
553 | | - 'type' => 'varchar', |
554 | | - 'length' => 255, |
555 | | - 'binary' => true, |
556 | | - 'null' => false, |
557 | | - 'default' => '', |
558 | | - ), |
559 | | - ), |
560 | | - 'indexes' => array( |
561 | | - 'il_from' => array( |
562 | | - 'UNIQUE', 'from','to', |
563 | | - ), |
564 | | - 'il_namespace' => array( |
565 | | - 'UNIQUE', 'to', 'from', |
566 | | - ), |
567 | | - ), |
568 | | - ), |
569 | | - 'categorylinks' => array( |
570 | | - 'prefix' => 'cl', |
571 | | - 'fields' => array( |
572 | | - 'from' => array( |
573 | | - 'type' => 'int', |
574 | | - 'null' => false, |
575 | | - 'default' => 0, |
576 | | - 'signed' => false, |
577 | | - ), |
578 | | - 'to' => array( |
579 | | - 'type' => 'varchar', |
580 | | - 'length' => 255, |
581 | | - 'binary' => true, |
582 | | - 'null' => false, |
583 | | - 'default' => '', |
584 | | - ), |
585 | | - 'sortkey' => array( |
586 | | - 'type' => 'varchar', |
587 | | - 'length' => 70, |
588 | | - 'binary' => true, |
589 | | - 'null' => false, |
590 | | - 'default' => '', |
591 | | - ), |
592 | | - 'timestamp' => array( |
593 | | - 'type' => 'datetime', |
594 | | - 'null' => false, |
595 | | - ), |
596 | | - ), |
597 | | - 'indexes' => array( |
598 | | - 'cl_from' => array( |
599 | | - 'UNIQUE', 'from','to', |
600 | | - ), |
601 | | - 'cl_sortkey' => array( |
602 | | - 'to', 'sortkey', 'from', |
603 | | - ), |
604 | | - 'cl_timestamp' => array( |
605 | | - 'to', 'timestamp', |
606 | | - ), |
607 | | - ), |
608 | | - ), |
609 | | - 'category' => array( |
610 | | - 'prefix' => 'cat', |
611 | | - 'fields' => array( |
612 | | - 'id' => array( |
613 | | - 'type' => 'int', |
614 | | - 'null' => false, |
615 | | - 'auto-increment' => true, |
616 | | - 'primary-key' => true, |
617 | | - 'signed' => false, |
618 | | - ), |
619 | | - 'title' => array( |
620 | | - 'type' => 'varchar', |
621 | | - 'length' => 255, |
622 | | - 'binary' => true, |
623 | | - 'null' => false, |
624 | | - ), |
625 | | - 'pages' => array( |
626 | | - 'type' => 'int', |
627 | | - 'signed' => true, |
628 | | - 'null' => false, |
629 | | - 'default' => 0, |
630 | | - ), |
631 | | - 'subcats' => array( |
632 | | - 'type' => 'int', |
633 | | - 'signed' => true, |
634 | | - 'null' => false, |
635 | | - 'default' => 0, |
636 | | - ), |
637 | | - 'files' => array( |
638 | | - 'type' => 'int', |
639 | | - 'signed' => true, |
640 | | - 'null' => false, |
641 | | - 'default' => 0, |
642 | | - ), |
643 | | - 'hidden' => array( |
644 | | - 'type' => 'int', |
645 | | - 'length' => 'tiny', |
646 | | - 'null' => false, |
647 | | - 'default' => 0, |
648 | | - 'signed' => false, |
649 | | - ), |
650 | | - ), |
651 | | - 'prefixes' => array( |
652 | | - 'cat_title' => array( |
653 | | - 'UNIQUE', 'title' |
654 | | - ), |
655 | | - 'cat_pages' => array( |
656 | | - 'pages' |
657 | | - ) |
658 | | - ), |
659 | | - ), |
660 | | - 'externallinks' => array( |
661 | | - 'prefix' => 'el', |
662 | | - 'fields' => array( |
663 | | - 'from' => array( |
664 | | - 'type' => 'int', |
665 | | - 'default' => 0, |
666 | | - 'null' => false, |
667 | | - 'signed' => false, |
668 | | - ), |
669 | | - 'to' => array( |
670 | | - 'type' => 'blob', |
671 | | - 'null' => false, |
672 | | - ), |
673 | | - 'index' => array( |
674 | | - 'type' => 'blob', |
675 | | - 'null' => false, |
676 | | - ), |
677 | | - ), |
678 | | - 'indexes' => array( |
679 | | - |
680 | | - ), |
681 | | - ), |
682 | | - 'externaluser' => array( |
683 | | - 'prefix' => 'eu', |
684 | | - 'fields' => array( |
685 | | - 'local_id' => array( |
686 | | - 'type' => 'int', |
687 | | - 'null' => false, |
688 | | - 'primary-key' => true, |
689 | | - 'signed' => false, |
690 | | - ), |
691 | | - 'external_id' => array( |
692 | | - 'type' => 'varchar', |
693 | | - 'length' => 255, |
694 | | - 'binary' => true, |
695 | | - 'null' => false, |
696 | | - ), |
697 | | - ), |
698 | | - 'indexes' => array( |
699 | | - 'eu_external_id' => array( |
700 | | - 'UNIQUE', 'external_id' |
701 | | - ), |
702 | | - ), |
703 | | - ), |
704 | | - 'langlinks' => array( |
705 | | - 'prefix' => 'll', |
706 | | - 'fields' => array( |
707 | | - 'from' => array( |
708 | | - 'type' => 'int', |
709 | | - 'default' => 0, |
710 | | - 'null' => false, |
711 | | - 'signed' => false, |
712 | | - ), |
713 | | - 'lang' => array( |
714 | | - 'type' => 'varbinary', |
715 | | - 'length' => 20, |
716 | | - 'null' => false, |
717 | | - 'default' => '', |
718 | | - ), |
719 | | - 'title' => array( |
720 | | - 'type' => 'varchar', |
721 | | - 'length' => 255, |
722 | | - 'binary' => true, |
723 | | - 'null' => false, |
724 | | - 'default' => '', |
725 | | - ), |
726 | | - ), |
727 | | - 'indexes' => array( |
728 | | - 'll_from' => array( |
729 | | - 'UNIQUE', 'from', 'lang' |
730 | | - ), |
731 | | - 'll_lang' => array( |
732 | | - 'lang', 'title' |
733 | | - ), |
734 | | - ), |
735 | | - ), |
736 | | - 'site_stats' => array( |
737 | | - 'prefix' => 'ss', |
738 | | - 'fields' => array( |
739 | | - 'row_id' => array( |
740 | | - 'type' => 'int', |
741 | | - 'signed' => false, |
742 | | - 'null' => false, |
743 | | - ), |
744 | | - 'total_views' => array( |
745 | | - 'type' => 'int', |
746 | | - 'signed' => false, |
747 | | - 'length' => 'big', |
748 | | - 'default' => 0, |
749 | | - ), |
750 | | - 'total_edits' => array( |
751 | | - 'type' => 'int', |
752 | | - 'signed' => false, |
753 | | - 'length' => 'big', |
754 | | - 'default' => 0, |
755 | | - ), |
756 | | - 'good_articles' => array( |
757 | | - 'type' => 'int', |
758 | | - 'signed' => false, |
759 | | - 'length' => 'big', |
760 | | - 'default' => 0, |
761 | | - ), |
762 | | - 'total_pages' => array( |
763 | | - 'type' => 'int', |
764 | | - 'length' => 'big', |
765 | | - 'default' => -1, |
766 | | - ), |
767 | | - 'users' => array( |
768 | | - 'type' => 'int', |
769 | | - 'length' => 'big', |
770 | | - 'default' => -1, |
771 | | - ), |
772 | | - 'active_users' => array( |
773 | | - 'type' => 'int', |
774 | | - 'length' => 'big', |
775 | | - 'default' => -1, |
776 | | - ), |
777 | | - 'admins' => array( |
778 | | - 'type' => 'int', |
779 | | - 'default' => -1, |
780 | | - ), |
781 | | - 'images' => array( |
782 | | - 'type' => 'int', |
783 | | - 'default' => 0, |
784 | | - ), |
785 | | - ), |
786 | | - 'indexes' => array( |
787 | | - 'ss_row_id' => array( |
788 | | - 'UNIQUE', 'row_id' |
789 | | - ) |
790 | | - ), |
791 | | - ), |
792 | | - 'hitcounter' => array( |
793 | | - 'prefix' => 'hc', |
794 | | - 'fields' => array( |
795 | | - 'id' => array( |
796 | | - 'type' => 'int', |
797 | | - 'signed' => false, |
798 | | - 'null' => false, |
799 | | - ), |
800 | | - ), |
801 | | - ), |
802 | | - 'ipblocks' => array( |
803 | | - 'prefix' => 'ipb', |
804 | | - 'fields' => array( |
805 | | - 'id' => array( |
806 | | - 'type' => 'int', |
807 | | - 'null' => false, |
808 | | - 'auto-increment' => true, |
809 | | - 'primary-key' => true, |
810 | | - ), |
811 | | - 'address' => array( |
812 | | - 'type' => 'blob', |
813 | | - 'length' => 'tiny', |
814 | | - 'null' => false, |
815 | | - ), |
816 | | - 'user' => array( |
817 | | - 'type' => 'int', |
818 | | - 'default' => 0, |
819 | | - 'null' => false, |
820 | | - 'signed' => false, |
821 | | - ), |
822 | | - 'by' => array( |
823 | | - 'type' => 'int', |
824 | | - 'default' => 0, |
825 | | - 'null' => false, |
826 | | - 'signed' => false, |
827 | | - ), |
828 | | - 'by_text' => array( |
829 | | - 'type' => 'varchar', |
830 | | - 'length' => 255, |
831 | | - 'binary' => true, |
832 | | - 'null' => false, |
833 | | - 'default' => '', |
834 | | - ), |
835 | | - 'reason' => array( |
836 | | - 'type' => 'blob', |
837 | | - 'length' => 'tiny', |
838 | | - 'null' => false, |
839 | | - ), |
840 | | - 'timestamp' => array( |
841 | | - 'type' => 'datetime', |
842 | | - 'null' => false, |
843 | | - 'default' => '', |
844 | | - ), |
845 | | - 'auto' => array( |
846 | | - 'type' => 'bool', |
847 | | - 'null' => false, |
848 | | - 'default' => 0, |
849 | | - ), |
850 | | - 'anon_only' => array( |
851 | | - 'type' => 'bool', |
852 | | - 'null' => false, |
853 | | - 'default' => 0, |
854 | | - ), |
855 | | - 'create_account' => array( |
856 | | - 'type' => 'bool', |
857 | | - 'null' => false, |
858 | | - 'default' => 1, |
859 | | - ), |
860 | | - 'enable_autoblock' => array( |
861 | | - 'type' => 'bool', |
862 | | - 'null' => false, |
863 | | - 'default' => 1, |
864 | | - ), |
865 | | - 'expiry' => array( |
866 | | - 'type' => 'datetime', |
867 | | - 'null' => false, |
868 | | - 'default' => '', |
869 | | - ), |
870 | | - 'range_start' => array( |
871 | | - 'type' => 'blob', |
872 | | - 'length' => 'tiny', |
873 | | - 'null' => false, |
874 | | - ), |
875 | | - 'range_end' => array( |
876 | | - 'type' => 'blob', |
877 | | - 'length' => 'tiny', |
878 | | - 'null' => false, |
879 | | - ), |
880 | | - 'deleted' => array( |
881 | | - 'type' => 'bool', |
882 | | - 'null' => false, |
883 | | - 'default' => 0, |
884 | | - ), |
885 | | - 'block_email' => array( |
886 | | - 'type' => 'bool', |
887 | | - 'null' => false, |
888 | | - 'default' => 0, |
889 | | - ), |
890 | | - 'allow_usertalk' => array( |
891 | | - 'type' => 'bool', |
892 | | - 'null' => false, |
893 | | - 'default' => 0, |
894 | | - ), |
895 | | - ), |
896 | | - 'indexes' => array( |
897 | | - |
898 | | - ), |
899 | | - ), |
900 | | - 'image' => array( |
901 | | - 'prefix' => 'img', |
902 | | - 'fields' => array( |
903 | | - 'name' => array( |
904 | | - 'type' => 'varchar', |
905 | | - 'length' => 255, |
906 | | - 'binary' => true, |
907 | | - 'null' => false, |
908 | | - 'default' => '', |
909 | | - 'primary-key' => true, |
910 | | - ), |
911 | | - 'size' => array( |
912 | | - 'type' => 'int', |
913 | | - 'signed' => false, |
914 | | - 'null' => false, |
915 | | - 'default' => 0, |
916 | | - ), |
917 | | - 'width' => array( |
918 | | - 'type' => 'int', |
919 | | - 'null' => false, |
920 | | - 'default' => 0, |
921 | | - ), |
922 | | - 'height' => array( |
923 | | - 'type' => 'int', |
924 | | - 'null' => false, |
925 | | - 'default' => 0, |
926 | | - ), |
927 | | - 'metadata' => array( |
928 | | - 'type' => 'blob', |
929 | | - 'length' => 'medium', |
930 | | - 'null' => false, |
931 | | - ), |
932 | | - 'bits' => array( |
933 | | - 'type' => 'int', |
934 | | - 'null' => false, |
935 | | - 'default' => 0, |
936 | | - ), |
937 | | - 'media_type' => array( |
938 | | - 'type' => 'enum', |
939 | | - 'values' => array( |
940 | | - "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", |
941 | | - "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE" |
942 | | - ), |
943 | | - 'default' => null, |
944 | | - ), |
945 | | - 'major_mime' => array( |
946 | | - 'type' => 'enum', |
947 | | - 'null' => false, |
948 | | - 'values' => array( |
949 | | - "unknown", "application", "audio", "image", "text", |
950 | | - "video", "message", "model", "multipart" |
951 | | - ), |
952 | | - 'default' => 'unknown', |
953 | | - ), |
954 | | - 'minor_mime' => array( |
955 | | - 'type' => 'varbinary', |
956 | | - 'length' => 32, |
957 | | - 'null' => false, |
958 | | - 'default' => 'unknown', |
959 | | - ), |
960 | | - 'description' => array( |
961 | | - 'type' => 'blob', |
962 | | - 'length' => 'tiny', |
963 | | - 'null' => false, |
964 | | - ), |
965 | | - 'user' => array( |
966 | | - 'type' => 'int', |
967 | | - 'signed' => false, |
968 | | - 'null' => false, |
969 | | - 'default' => 0, |
970 | | - ), |
971 | | - 'user_text' => array( |
972 | | - 'type' => 'varchar', |
973 | | - 'length' => 255, |
974 | | - 'binary' => true, |
975 | | - 'null' => false, |
976 | | - ), |
977 | | - 'timestamp' => array( |
978 | | - 'type' => 'datetime', |
979 | | - 'null' => false, |
980 | | - 'default' => '', |
981 | | - ), |
982 | | - 'sha1' => array( |
983 | | - 'type' => 'varbinary', |
984 | | - 'length' => 32, |
985 | | - 'null' => false, |
986 | | - 'default' => '', |
987 | | - ), |
988 | | - ), |
989 | | - 'indexes' => array( |
990 | | - 'img_usertext_timestamp' => array( |
991 | | - 'user_text', 'timestamp' |
992 | | - ), |
993 | | - 'img_size' => array( |
994 | | - 'size' |
995 | | - ), |
996 | | - 'img_timestamp' => array( |
997 | | - 'timestamp' |
998 | | - ), |
999 | | - 'img_sha1' => array( |
1000 | | - 'sha1' |
1001 | | - ), |
1002 | | - ), |
1003 | | - ), |
1004 | | - 'oldimage' => array( |
1005 | | - 'prefix' => 'oi', |
1006 | | - 'fields' => array( |
1007 | | - 'name' => array( |
1008 | | - 'type' => 'varchar', |
1009 | | - 'length' => 255, |
1010 | | - 'binary' => true, |
1011 | | - 'null' => false, |
1012 | | - 'default' => '', |
1013 | | - ), |
1014 | | - 'archive_name' => array( |
1015 | | - 'type' => 'varchar', |
1016 | | - 'length' => 255, |
1017 | | - 'binary' => true, |
1018 | | - 'null' => false, |
1019 | | - 'default' => '', |
1020 | | - ), |
1021 | | - 'size' => array( |
1022 | | - 'type' => 'int', |
1023 | | - 'signed' => false, |
1024 | | - 'null' => false, |
1025 | | - 'default' => 0, |
1026 | | - ), |
1027 | | - 'width' => array( |
1028 | | - 'type' => 'int', |
1029 | | - 'null' => false, |
1030 | | - 'default' => 0, |
1031 | | - ), |
1032 | | - 'height' => array( |
1033 | | - 'type' => 'int', |
1034 | | - 'null' => false, |
1035 | | - 'default' => 0, |
1036 | | - ), |
1037 | | - 'metadata' => array( |
1038 | | - 'type' => 'blob', |
1039 | | - 'length' => 'medium', |
1040 | | - 'null' => false, |
1041 | | - ), |
1042 | | - 'bits' => array( |
1043 | | - 'type' => 'int', |
1044 | | - 'null' => false, |
1045 | | - 'default' => 0, |
1046 | | - ), |
1047 | | - 'media_type' => array( |
1048 | | - 'type' => 'enum', |
1049 | | - 'values' => array( |
1050 | | - "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", |
1051 | | - "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE" |
1052 | | - ), |
1053 | | - 'default' => null, |
1054 | | - ), |
1055 | | - 'major_mime' => array( |
1056 | | - 'type' => 'enum', |
1057 | | - 'null' => false, |
1058 | | - 'values' => array( |
1059 | | - "unknown", "application", "audio", "image", "text", |
1060 | | - "video", "message", "model", "multipart" |
1061 | | - ), |
1062 | | - 'default' => 'unknown', |
1063 | | - ), |
1064 | | - 'minor_mime' => array( |
1065 | | - 'type' => 'varbinary', |
1066 | | - 'length' => 32, |
1067 | | - 'null' => false, |
1068 | | - 'default' => 'unknown', |
1069 | | - ), |
1070 | | - 'description' => array( |
1071 | | - 'type' => 'blob', |
1072 | | - 'length' => 'tiny', |
1073 | | - 'null' => false, |
1074 | | - ), |
1075 | | - 'user' => array( |
1076 | | - 'type' => 'int', |
1077 | | - 'signed' => false, |
1078 | | - 'null' => false, |
1079 | | - 'default' => 0, |
1080 | | - ), |
1081 | | - 'user_text' => array( |
1082 | | - 'type' => 'varchar', |
1083 | | - 'length' => 255, |
1084 | | - 'binary' => true, |
1085 | | - 'null' => false, |
1086 | | - ), |
1087 | | - 'timestamp' => array( |
1088 | | - 'type' => 'datetime', |
1089 | | - 'null' => false, |
1090 | | - 'default' => '', |
1091 | | - ), |
1092 | | - 'sha1' => array( |
1093 | | - 'type' => 'varbinary', |
1094 | | - 'length' => 32, |
1095 | | - 'null' => false, |
1096 | | - 'default' => '', |
1097 | | - ), |
1098 | | - ), |
1099 | | - 'indexes' => array( |
1100 | | - 'oi_usertext_timestamp' => array( |
1101 | | - 'user_text', 'timestamp' |
1102 | | - ), |
1103 | | - 'oi_name_timestamp' => array( |
1104 | | - 'name', 'timestamp' |
1105 | | - ), |
1106 | | - 'oi_name_archive_name' => array( |
1107 | | - 'name', 'archive_name' |
1108 | | - ), |
1109 | | - 'oi_sha1' => array( |
1110 | | - 'sha1' |
1111 | | - ), |
1112 | | - ), |
1113 | | - ), |
1114 | | - 'filearchive' => array( |
1115 | | - 'prefix' => 'fa', |
1116 | | - 'fields' => array( |
1117 | | - 'id' => array( |
1118 | | - 'type' => 'int', |
1119 | | - 'null' => false, |
1120 | | - 'auto-increment' => true, |
1121 | | - 'primary-key' => true, |
1122 | | - ), |
1123 | | - 'name' => array( |
1124 | | - 'type' => 'varchar', |
1125 | | - 'length' => 255, |
1126 | | - 'binary' => true, |
1127 | | - 'null' => false, |
1128 | | - 'default' => '', |
1129 | | - ), |
1130 | | - 'archive_name' => array( |
1131 | | - 'type' => 'varchar', |
1132 | | - 'length' => 255, |
1133 | | - 'binary' => true, |
1134 | | - 'default' => '', |
1135 | | - ), |
1136 | | - 'storage_group' => array( |
1137 | | - 'type' => 'varbinary', |
1138 | | - 'length' => 16, |
1139 | | - ), |
1140 | | - 'storage_key' => array( |
1141 | | - 'type' => 'varbinary', |
1142 | | - 'length' => 64, |
1143 | | - 'default' => '', |
1144 | | - ), |
1145 | | - 'deleted_user' => array( |
1146 | | - 'type' => 'int', |
1147 | | - ), |
1148 | | - 'deleted_timestamp' => array( |
1149 | | - 'type' => 'datetime', |
1150 | | - 'default' => '', |
1151 | | - ), |
1152 | | - 'deleted_reason' => array( |
1153 | | - 'type' => 'text', |
1154 | | - ), |
1155 | | - 'size' => array( |
1156 | | - 'type' => 'int', |
1157 | | - 'signed' => false, |
1158 | | - 'default' => 0, |
1159 | | - ), |
1160 | | - 'width' => array( |
1161 | | - 'type' => 'int', |
1162 | | - 'null' => false, |
1163 | | - 'default' => 0, |
1164 | | - ), |
1165 | | - 'height' => array( |
1166 | | - 'type' => 'int', |
1167 | | - 'null' => false, |
1168 | | - 'default' => 0, |
1169 | | - ), |
1170 | | - 'metadata' => array( |
1171 | | - 'type' => 'blob', |
1172 | | - 'length' => 'medium', |
1173 | | - ), |
1174 | | - 'bits' => array( |
1175 | | - 'type' => 'int', |
1176 | | - 'default' => 0, |
1177 | | - ), |
1178 | | - 'media_type' => array( |
1179 | | - 'type' => 'enum', |
1180 | | - 'values' => array( |
1181 | | - "UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", |
1182 | | - "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE" |
1183 | | - ), |
1184 | | - 'default' => null, |
1185 | | - ), |
1186 | | - 'major_mime' => array( |
1187 | | - 'type' => 'enum', |
1188 | | - 'null' => false, |
1189 | | - 'values' => array( |
1190 | | - "unknown", "application", "audio", "image", "text", |
1191 | | - "video", "message", "model", "multipart" |
1192 | | - ), |
1193 | | - 'default' => 'unknown', |
1194 | | - ), |
1195 | | - 'minor_mime' => array( |
1196 | | - 'type' => 'varbinary', |
1197 | | - 'length' => 32, |
1198 | | - 'default' => 'unknown', |
1199 | | - ), |
1200 | | - 'description' => array( |
1201 | | - 'type' => 'blob', |
1202 | | - 'length' => 'tiny', |
1203 | | - ), |
1204 | | - 'user' => array( |
1205 | | - 'type' => 'int', |
1206 | | - 'signed' => false, |
1207 | | - 'default' => 0, |
1208 | | - ), |
1209 | | - 'user_text' => array( |
1210 | | - 'type' => 'varchar', |
1211 | | - 'length' => 255, |
1212 | | - 'binary' => true, |
1213 | | - ), |
1214 | | - 'timestamp' => array( |
1215 | | - 'type' => 'datetime', |
1216 | | - 'default' => '', |
1217 | | - ), |
1218 | | - 'deleted' => array( |
1219 | | - 'type' => 'int', |
1220 | | - 'length' => 'tiny', |
1221 | | - 'null' => false, |
1222 | | - 'signed' => false, |
1223 | | - 'default' => 0, |
1224 | | - ), |
1225 | | - ), |
1226 | | - 'indexes' => array( |
1227 | | - 'fa_name' => array( |
1228 | | - 'name', 'timestamp', |
1229 | | - ), |
1230 | | - 'fa_storage_group' => array( |
1231 | | - 'storage_group', 'storage_key', |
1232 | | - ), |
1233 | | - 'fa_deleted_timestamp' => array( |
1234 | | - 'deleted_timestamp', |
1235 | | - ), |
1236 | | - 'fa_user_timestamp' => array( |
1237 | | - 'user_text', 'timestamp', |
1238 | | - ), |
1239 | | - ), |
1240 | | - ), |
1241 | | - 'recentchanges' => array( |
1242 | | - 'prefix' => 'rc', |
1243 | | - 'fields' => array( |
1244 | | - 'id' => array( |
1245 | | - 'type' => 'int', |
1246 | | - 'null' => false, |
1247 | | - 'auto-increment' => true, |
1248 | | - 'primary-key' => true, |
1249 | | - ), |
1250 | | - 'timestamp' => array( |
1251 | | - 'type' => 'datetime', |
1252 | | - 'null' => false, |
1253 | | - 'default' => '', |
1254 | | - ), |
1255 | | - 'cur_time' => array( |
1256 | | - 'type' => 'datetime', |
1257 | | - 'null' => false, |
1258 | | - 'default' => '', |
1259 | | - ), |
1260 | | - 'user' => array( |
1261 | | - 'type' => 'int', |
1262 | | - 'null' => false, |
1263 | | - 'default' => 0, |
1264 | | - 'signed' => false, |
1265 | | - ), |
1266 | | - 'user_text' => array( |
1267 | | - 'type' => 'varchar', |
1268 | | - 'length' => 255, |
1269 | | - 'binary' => true, |
1270 | | - 'null' => false, |
1271 | | - ), |
1272 | | - 'namespace' => array( |
1273 | | - 'type' => 'int', |
1274 | | - 'null' => false, |
1275 | | - 'default' => 0, |
1276 | | - ), |
1277 | | - 'title' => array( |
1278 | | - 'type' => 'varchar', |
1279 | | - 'length' => 255, |
1280 | | - 'binary' => true, |
1281 | | - 'null' => false, |
1282 | | - 'default' => '', |
1283 | | - ), |
1284 | | - 'comment' => array( |
1285 | | - 'type' => 'varchar', |
1286 | | - 'length' => 255, |
1287 | | - 'binary' => true, |
1288 | | - 'null' => false, |
1289 | | - 'default' => '', |
1290 | | - ), |
1291 | | - 'minor' => array( |
1292 | | - 'type' => 'int', |
1293 | | - 'null' => false, |
1294 | | - 'default' => 0, |
1295 | | - 'length' => 'tiny', |
1296 | | - 'signed' => false, |
1297 | | - ), |
1298 | | - 'bot' => array( |
1299 | | - 'type' => 'int', |
1300 | | - 'null' => false, |
1301 | | - 'default' => 0, |
1302 | | - 'length' => 'tiny', |
1303 | | - 'signed' => false, |
1304 | | - ), |
1305 | | - 'new' => array( |
1306 | | - 'type' => 'int', |
1307 | | - 'null' => false, |
1308 | | - 'default' => 0, |
1309 | | - 'length' => 'tiny', |
1310 | | - 'signed' => false, |
1311 | | - ), |
1312 | | - 'cur_id' => array( |
1313 | | - 'type' => 'int', |
1314 | | - 'null' => false, |
1315 | | - 'default' => 0, |
1316 | | - 'signed' => false, |
1317 | | - ), |
1318 | | - 'this_oldid' => array( |
1319 | | - 'type' => 'int', |
1320 | | - 'null' => false, |
1321 | | - 'default' => 0, |
1322 | | - 'signed' => false, |
1323 | | - ), |
1324 | | - 'last_oldid' => array( |
1325 | | - 'type' => 'int', |
1326 | | - 'null' => false, |
1327 | | - 'default' => 0, |
1328 | | - 'signed' => false, |
1329 | | - ), |
1330 | | - 'type' => array( |
1331 | | - 'type' => 'int', |
1332 | | - 'null' => false, |
1333 | | - 'default' => 0, |
1334 | | - 'length' => 'tiny', |
1335 | | - 'signed' => false, |
1336 | | - ), |
1337 | | - 'moved_to_ns' => array( |
1338 | | - 'type' => 'int', |
1339 | | - 'null' => false, |
1340 | | - 'default' => 0, |
1341 | | - 'length' => 'tiny', |
1342 | | - 'signed' => false, |
1343 | | - ), |
1344 | | - 'moved_to_title' => array( |
1345 | | - 'type' => 'varchar', |
1346 | | - 'length' => 255, |
1347 | | - 'binary' => true, |
1348 | | - 'null' => false, |
1349 | | - 'default' => '', |
1350 | | - ), |
1351 | | - 'patrolled' => array( |
1352 | | - 'type' => 'int', |
1353 | | - 'null' => false, |
1354 | | - 'default' => 0, |
1355 | | - 'length' => 'tiny', |
1356 | | - 'signed' => false, |
1357 | | - ), |
1358 | | - 'ip' => array( |
1359 | | - 'type' => 'varbinary', |
1360 | | - 'length' => 40, |
1361 | | - 'null' => false, |
1362 | | - 'default' => '', |
1363 | | - ), |
1364 | | - 'old_len' => array( |
1365 | | - 'type' => 'int', |
1366 | | - ), |
1367 | | - 'new_len' => array( |
1368 | | - 'type' => 'int', |
1369 | | - ), |
1370 | | - 'deleted' => array( |
1371 | | - 'type' => 'int', |
1372 | | - 'null' => false, |
1373 | | - 'default' => 0, |
1374 | | - 'length' => 'tiny', |
1375 | | - 'signed' => false, |
1376 | | - ), |
1377 | | - 'log_id' => array( |
1378 | | - 'type' => 'int', |
1379 | | - 'null' => false, |
1380 | | - 'default' => 0, |
1381 | | - 'signed' => false, |
1382 | | - ), |
1383 | | - 'log_type' => array( |
1384 | | - 'type' => 'varbinary', |
1385 | | - 'length' => 255, |
1386 | | - 'null' => true, |
1387 | | - 'default' => null, |
1388 | | - ), |
1389 | | - 'log_action' => array( |
1390 | | - 'type' => 'varbinary', |
1391 | | - 'length' => 255, |
1392 | | - 'null' => true, |
1393 | | - 'default' => null, |
1394 | | - ), |
1395 | | - 'log_params' => array( |
1396 | | - 'type' => 'blob', |
1397 | | - 'null' => true, |
1398 | | - ), |
1399 | | - ), |
1400 | | - 'indexes' => array( |
1401 | | - 'rc_timestamp' => array( |
1402 | | - 'timestamp', |
1403 | | - ), |
1404 | | - 'rc_namespace_title' => array( |
1405 | | - 'namespace', 'title', |
1406 | | - ), |
1407 | | - 'rc_cur_id' => array( |
1408 | | - 'cur_id', |
1409 | | - ), |
1410 | | - 'new_name_timestamp' => array( |
1411 | | - 'new', 'namespace', 'timestamp', |
1412 | | - ), |
1413 | | - 'rc_ip' => array( |
1414 | | - 'ip', |
1415 | | - ), |
1416 | | - 'rc_ns_usertext' => array( |
1417 | | - 'namespace', 'user_text', |
1418 | | - ), |
1419 | | - 'rc_user_text' => array( |
1420 | | - 'user_text', 'timestamp', |
1421 | | - ), |
1422 | | - ), |
1423 | | - ), |
1424 | | - 'watchlist' => array( |
1425 | | - 'prefix' => 'wl', |
1426 | | - 'fields' => array( |
1427 | | - 'user' => array( |
1428 | | - 'type' => 'int', |
1429 | | - 'signed' => false, |
1430 | | - 'null' => false, |
1431 | | - ), |
1432 | | - 'namespace' => array( |
1433 | | - 'type' => 'int', |
1434 | | - 'default' => 0, |
1435 | | - 'null' => false, |
1436 | | - ), |
1437 | | - 'title' => array( |
1438 | | - 'type' => 'varchar', |
1439 | | - 'length' => 255, |
1440 | | - 'binary' => true, |
1441 | | - 'null' => false, |
1442 | | - 'default' => '', |
1443 | | - ), |
1444 | | - 'notificationtimestamp' => array( |
1445 | | - 'type' => 'datetime', |
1446 | | - ), |
1447 | | - ), |
1448 | | - 'indexes' => array( |
1449 | | - 'wl_user' => array( |
1450 | | - 'UNIQUE', 'user', 'namespace', 'title', |
1451 | | - ), |
1452 | | - 'namespace_title' => array( |
1453 | | - 'namespace', 'title', |
1454 | | - ), |
1455 | | - ), |
1456 | | - ), |
1457 | | - 'math' => array( |
1458 | | - 'prefix' => 'math', |
1459 | | - 'fields' => array( |
1460 | | - 'inputhash' => array( |
1461 | | - 'type' => 'varbinary', |
1462 | | - 'length' => 16, |
1463 | | - 'null' => false, |
1464 | | - ), |
1465 | | - 'outputhash' => array( |
1466 | | - 'type' => 'varbinary', |
1467 | | - 'length' => 16, |
1468 | | - 'null' => false, |
1469 | | - ), |
1470 | | - 'html_conservativeness' => array( |
1471 | | - 'type' => 'int', |
1472 | | - 'null' => false, |
1473 | | - 'length' => 'tiny', |
1474 | | - ), |
1475 | | - 'html' => array( |
1476 | | - 'type' => 'text', |
1477 | | - ), |
1478 | | - 'mathml' => array( |
1479 | | - 'type' => 'text', |
1480 | | - ), |
1481 | | - ), |
1482 | | - 'indexes' => array( |
1483 | | - 'math_inputhash' => array( |
1484 | | - 'UNIQUE', 'inputhash', |
1485 | | - ), |
1486 | | - ), |
1487 | | - ), |
1488 | | - 'interwiki' => array( |
1489 | | - 'prefix' => 'iw', |
1490 | | - 'fields' => array( |
1491 | | - 'prefix' => array( |
1492 | | - 'type' => 'varchar', |
1493 | | - 'length' => 32, |
1494 | | - 'null' => false, |
1495 | | - ), |
1496 | | - 'url' => array( |
1497 | | - 'type' => 'blob', |
1498 | | - 'null' => false, |
1499 | | - ), |
1500 | | - 'local' => array( |
1501 | | - 'type' => 'bool', |
1502 | | - 'null' => false, |
1503 | | - ), |
1504 | | - 'trans' => array( |
1505 | | - 'type' => 'int', |
1506 | | - 'length' => 'tiny', |
1507 | | - 'null' => false, |
1508 | | - 'default' => 0, |
1509 | | - ), |
1510 | | - ), |
1511 | | - 'indexes' => array( |
1512 | | - 'iw_prefix' => array( |
1513 | | - 'UNIQUE', 'prefix', |
1514 | | - ), |
1515 | | - ), |
1516 | | - ), |
1517 | | - 'querycache' => array( |
1518 | | - 'prefix' => 'qc', |
1519 | | - 'fields' => array( |
1520 | | - 'type' => array( |
1521 | | - 'type' => 'varbinary', |
1522 | | - 'length' => 32, |
1523 | | - 'null' => false, |
1524 | | - ), |
1525 | | - 'value' => array( |
1526 | | - 'type' => 'int', |
1527 | | - 'signed' => false, |
1528 | | - 'null' => false, |
1529 | | - 'default' => 0, |
1530 | | - ), |
1531 | | - 'namespace' => array( |
1532 | | - 'type' => 'int', |
1533 | | - 'null' => false, |
1534 | | - 'default' => 0, |
1535 | | - ), |
1536 | | - 'title' => array( |
1537 | | - 'type' => 'varchar', |
1538 | | - 'length' => 255, |
1539 | | - 'binary' => true, |
1540 | | - 'null' => false, |
1541 | | - 'default' => '', |
1542 | | - ), |
1543 | | - ), |
1544 | | - 'indexes' => array( |
1545 | | - 'qc_type' => array( |
1546 | | - 'type', 'value', |
1547 | | - ), |
1548 | | - ), |
1549 | | - ), |
1550 | | - 'objectcache' => array( |
1551 | | - 'prefix' => '', |
1552 | | - 'fields' => array( |
1553 | | - 'keyname' => array( |
1554 | | - 'type' => 'varbinary', |
1555 | | - 'length' => 255, |
1556 | | - 'null' => false, |
1557 | | - 'default' => '', |
1558 | | - 'primary-key' => true, |
1559 | | - ), |
1560 | | - 'value' => array( |
1561 | | - 'type' => 'blob', |
1562 | | - 'length' => 'medium', |
1563 | | - ), |
1564 | | - 'exptime' => array( |
1565 | | - 'type' => 'datetime', |
1566 | | - ), |
1567 | | - ), |
1568 | | - 'indexes' => array( |
1569 | | - 'exptime' => array( |
1570 | | - 'exptime', |
1571 | | - ), |
1572 | | - ), |
1573 | | - ), |
1574 | | - 'transcache' => array( |
1575 | | - 'prefix' => 'tc', |
1576 | | - 'fields' => array( |
1577 | | - 'url' => array( |
1578 | | - 'type' => 'varbinary', |
1579 | | - 'length' => 255, |
1580 | | - 'null' => false, |
1581 | | - ), |
1582 | | - 'contents' => array( |
1583 | | - 'type' => 'text', |
1584 | | - ), |
1585 | | - 'time' => array( |
1586 | | - 'type' => 'datetime', |
1587 | | - 'null' => false, |
1588 | | - ), |
1589 | | - ), |
1590 | | - 'indexes' => array( |
1591 | | - 'tc_url_idx' => array( |
1592 | | - 'UNIQUE', 'url', |
1593 | | - ), |
1594 | | - ), |
1595 | | - ), |
1596 | | - 'logging' => array( |
1597 | | - 'prefix' => 'log', |
1598 | | - 'fields' => array( |
1599 | | - 'id' => array( |
1600 | | - 'type' => 'int', |
1601 | | - 'signed' => false, |
1602 | | - 'null' => false, |
1603 | | - 'primary-key' => true, |
1604 | | - 'auto-increment' => true, |
1605 | | - ), |
1606 | | - 'type' => array( |
1607 | | - 'type' => 'varbinary', |
1608 | | - 'length' => 32, |
1609 | | - 'null' => false, |
1610 | | - 'default' => '', |
1611 | | - ), |
1612 | | - 'action' => array( |
1613 | | - 'type' => 'varbinary', |
1614 | | - 'length' => 32, |
1615 | | - 'null' => false, |
1616 | | - 'default' => '', |
1617 | | - ), |
1618 | | - 'timestamp' => array( |
1619 | | - 'type' => 'datetime', |
1620 | | - 'null' => false, |
1621 | | - 'default' => '19700101000000', |
1622 | | - ), |
1623 | | - 'user' => array( |
1624 | | - 'type' => 'int', |
1625 | | - 'signed' => false, |
1626 | | - 'null' => false, |
1627 | | - 'default' => 0, |
1628 | | - ), |
1629 | | - 'user_text' => array( |
1630 | | - 'type' => 'varchar', |
1631 | | - 'length' => 255, |
1632 | | - 'binary' => true, |
1633 | | - 'null' => false, |
1634 | | - 'default' => '', |
1635 | | - ), |
1636 | | - 'namespace' => array( |
1637 | | - 'type' => 'int', |
1638 | | - 'null' => false, |
1639 | | - 'default' => 0, |
1640 | | - ), |
1641 | | - 'title' => array( |
1642 | | - 'type' => 'varchar', |
1643 | | - 'length' => 255, |
1644 | | - 'binary' => true, |
1645 | | - 'null' => false, |
1646 | | - 'default' => '', |
1647 | | - ), |
1648 | | - 'page' => array( |
1649 | | - 'type' => 'int', |
1650 | | - 'signed' => false, |
1651 | | - 'null' => true, |
1652 | | - ), |
1653 | | - 'comment' => array( |
1654 | | - 'type' => 'varchar', |
1655 | | - 'length' => 255, |
1656 | | - 'null' => false, |
1657 | | - 'default' => '', |
1658 | | - ), |
1659 | | - 'params' => array( |
1660 | | - 'type' => 'blob', |
1661 | | - 'null' => false, |
1662 | | - ), |
1663 | | - 'deleted' => array( |
1664 | | - 'type' => 'int', |
1665 | | - 'length' => 'tiny', |
1666 | | - 'signed' => false, |
1667 | | - 'null' => false, |
1668 | | - 'default' => 0, |
1669 | | - ), |
1670 | | - ), |
1671 | | - 'indexes' => array( |
1672 | | - 'type_time' => array( |
1673 | | - 'type', 'timestamp', |
1674 | | - ), |
1675 | | - 'user_time' => array( |
1676 | | - 'user', 'timestamp', |
1677 | | - ), |
1678 | | - 'page_time' => array( |
1679 | | - 'namespace', 'title', 'timestamp', |
1680 | | - ), |
1681 | | - 'times' => array( |
1682 | | - 'timestamp', |
1683 | | - ), |
1684 | | - 'log_user_type_time' => array( |
1685 | | - 'user', 'type', 'timestamp', |
1686 | | - ), |
1687 | | - 'log_page_id_time' => array( |
1688 | | - 'page', 'timestamp', |
1689 | | - ), |
1690 | | - ), |
1691 | | - ), |
1692 | | - 'log_search' => array( |
1693 | | - 'prefix' => 'ls', |
1694 | | - 'fields' => array( |
1695 | | - 'field' => array( |
1696 | | - 'type' => 'varbinary', |
1697 | | - 'length' => 32, |
1698 | | - 'null' => false, |
1699 | | - ), |
1700 | | - 'value' => array( |
1701 | | - 'type' => 'varchar', |
1702 | | - 'length' => 255, |
1703 | | - 'null' => false, |
1704 | | - ), |
1705 | | - 'log_id' => array( |
1706 | | - 'type' => 'int', |
1707 | | - 'signed' => false, |
1708 | | - 'null' => false, |
1709 | | - 'default' => 0, |
1710 | | - ), |
1711 | | - ), |
1712 | | - 'indexes' => array( |
1713 | | - 'ls_field_val' => array( |
1714 | | - 'UNIQUE', 'field', 'value', 'log_id', |
1715 | | - ), |
1716 | | - 'ls_log_id' => array( |
1717 | | - 'log_id', |
1718 | | - ), |
1719 | | - ), |
1720 | | - ), |
1721 | | - 'trackbacks' => array( |
1722 | | - 'prefix' => 'tb', |
1723 | | - 'fields' => array( |
1724 | | - 'id' => array( |
1725 | | - 'type' => 'int', |
1726 | | - 'primary-key' => true, |
1727 | | - 'auto-increment' => true, |
1728 | | - ), |
1729 | | - 'page' => array( |
1730 | | - 'type' => 'int', |
1731 | | - /** @todo DO REST OF THIS FIELD **/ |
1732 | | - ), |
1733 | | - 'title' => array( |
1734 | | - 'type' => 'varchar', |
1735 | | - 'length' => 255, |
1736 | | - 'null' => false, |
1737 | | - ), |
1738 | | - 'url' => array( |
1739 | | - 'type' => 'blob', |
1740 | | - 'null' => false, |
1741 | | - ), |
1742 | | - 'ex' => array( |
1743 | | - 'type' => 'text', |
1744 | | - ), |
1745 | | - 'title' => array( |
1746 | | - 'type' => 'varchar', |
1747 | | - 'length' => 255, |
1748 | | - ), |
1749 | | - ), |
1750 | | - 'indexes' => array( |
1751 | | - 'tb_page' => array( |
1752 | | - 'page', |
1753 | | - ) |
1754 | | - ), |
1755 | | - ), |
1756 | | - 'job' => array( |
1757 | | - 'prefix' => 'job', |
1758 | | - 'fields' => array( |
1759 | | - 'id' => array( |
1760 | | - 'type' => 'int', |
1761 | | - 'signed' => false, |
1762 | | - 'null' => false, |
1763 | | - 'primary-key' => true, |
1764 | | - 'auto-increment' => true, |
1765 | | - ), |
1766 | | - 'cmd' => array( |
1767 | | - 'type' => 'varbinary', |
1768 | | - 'length' => 60, |
1769 | | - 'null' => false, |
1770 | | - 'default' => '', |
1771 | | - ), |
1772 | | - 'namespace' => array( |
1773 | | - 'type' => 'int', |
1774 | | - 'null' => false, |
1775 | | - ), |
1776 | | - 'title' => array( |
1777 | | - 'type' => 'varchar', |
1778 | | - 'length' => 255, |
1779 | | - 'binary' => true, |
1780 | | - 'null' => false, |
1781 | | - ), |
1782 | | - 'params' => array( |
1783 | | - 'type' => 'blob', |
1784 | | - 'null' => false, |
1785 | | - ), |
1786 | | - ), |
1787 | | - 'indexes' => array( |
1788 | | - 'job_cmd' => array( |
1789 | | - 'cmd', 'namespace', 'title', 'params' |
1790 | | - ), |
1791 | | - ), |
1792 | | - ), |
1793 | | - 'querycache_info' => array( |
1794 | | - 'prefix' => 'qci', |
1795 | | - 'fields' => array( |
1796 | | - 'type' => array( |
1797 | | - 'type' => 'varbinary', |
1798 | | - 'length' => 32, |
1799 | | - 'null' => false, |
1800 | | - 'default' => '', |
1801 | | - ), |
1802 | | - 'timestamp' => array( |
1803 | | - 'type' => 'datetime', |
1804 | | - 'null' => false, |
1805 | | - 'default' => '19700101000000', |
1806 | | - ), |
1807 | | - |
1808 | | - ), |
1809 | | - 'indexes' => array( |
1810 | | - 'qci_type' => array( |
1811 | | - 'UNIQUE', 'type' |
1812 | | - ) |
1813 | | - ), |
1814 | | - ), |
1815 | | - 'redirect' => array( |
1816 | | - 'prefix' => 'rd', |
1817 | | - 'fields' => array( |
1818 | | - 'from' => array( |
1819 | | - 'type' => 'int', |
1820 | | - 'signed' => false, |
1821 | | - 'null' => false, |
1822 | | - 'primary-key' => true, |
1823 | | - 'default' => 0, |
1824 | | - ), |
1825 | | - 'namespace' => array( |
1826 | | - 'type' => 'int', |
1827 | | - 'null' => false, |
1828 | | - 'default' => 0, |
1829 | | - ), |
1830 | | - 'title' => array( |
1831 | | - 'type' => 'varchar', |
1832 | | - 'length' => 255, |
1833 | | - 'binary' => true, |
1834 | | - 'null' => false, |
1835 | | - 'default' => '', |
1836 | | - ), |
1837 | | - 'interwiki' => array( |
1838 | | - 'type' => 'varchar', |
1839 | | - 'length' => 32, |
1840 | | - 'default' => null, |
1841 | | - ), |
1842 | | - 'fragment' => array( |
1843 | | - 'type' => 'varchar', |
1844 | | - 'length' => 255, |
1845 | | - 'binary' => true, |
1846 | | - 'default' => null, |
1847 | | - ), |
1848 | | - ), |
1849 | | - 'indexes' => array( |
1850 | | - 'rd_ns_title' => array( |
1851 | | - 'namespace', 'title', 'from' |
1852 | | - ), |
1853 | | - ), |
1854 | | - ), |
1855 | | - 'querycachetwo' => array( |
1856 | | - 'prefix' => 'qcc', |
1857 | | - 'fields' => array( |
1858 | | - 'type' => array( |
1859 | | - 'type' => 'varbinary', |
1860 | | - 'length' => 32, |
1861 | | - 'null' => false, |
1862 | | - ), |
1863 | | - 'value' => array( |
1864 | | - 'type' => 'int', |
1865 | | - 'signed' => false, |
1866 | | - 'null' => false, |
1867 | | - 'default' => 0, |
1868 | | - ), |
1869 | | - 'namespace' => array( |
1870 | | - 'type' => 'int', |
1871 | | - 'null' => false, |
1872 | | - 'default' => 0, |
1873 | | - ), |
1874 | | - 'title' => array( |
1875 | | - 'type' => 'varchar', |
1876 | | - 'length' => 255, |
1877 | | - 'binary' => true, |
1878 | | - 'null' => false, |
1879 | | - 'default' => '', |
1880 | | - ), |
1881 | | - 'namespacetwo' => array( |
1882 | | - 'type' => 'int', |
1883 | | - 'null' => false, |
1884 | | - 'default' => 0, |
1885 | | - ), |
1886 | | - 'titletwo' => array( |
1887 | | - 'type' => 'varchar', |
1888 | | - 'length' => 255, |
1889 | | - 'binary' => true, |
1890 | | - 'null' => false, |
1891 | | - 'default' => '', |
1892 | | - ), |
1893 | | - ), |
1894 | | - 'indexes' => array( |
1895 | | - 'qcc_type' => array( |
1896 | | - 'type', 'value', |
1897 | | - ), |
1898 | | - 'qcc_title' => array( |
1899 | | - 'type', 'namespace', 'title' |
1900 | | - ), |
1901 | | - 'qcc_titletwo' => array( |
1902 | | - 'type', 'namespacetwo', 'titletwo' |
1903 | | - ), |
1904 | | - ), |
1905 | | - ), |
1906 | | - 'page_restrictions' => array( |
1907 | | - 'prefix' => 'pr', |
1908 | | - 'fields' => array( |
1909 | | - 'page' => array( |
1910 | | - 'type' => 'int', |
1911 | | - 'null' => false, |
1912 | | - ), |
1913 | | - 'type' => array( |
1914 | | - 'type' => 'varbinary', |
1915 | | - 'length' => 60, |
1916 | | - 'null' => false, |
1917 | | - ), |
1918 | | - 'level' => array( |
1919 | | - 'type' => 'varbinary', |
1920 | | - 'length' => 60, |
1921 | | - 'null' => false, |
1922 | | - ), |
1923 | | - 'cascade' => array( |
1924 | | - 'type' => 'int', |
1925 | | - 'length' => 'tiny', |
1926 | | - 'null' => false, |
1927 | | - ), |
1928 | | - 'user' => array( |
1929 | | - 'type' => 'int', |
1930 | | - 'null' => true, |
1931 | | - ), |
1932 | | - 'expiry' => array( |
1933 | | - 'type' => 'datetime', |
1934 | | - 'null' => true, |
1935 | | - ), |
1936 | | - 'id' => array( |
1937 | | - 'type' => 'int', |
1938 | | - 'signed' => false, |
1939 | | - 'null' => false, |
1940 | | - 'primary-key' => true, |
1941 | | - 'auto-increment' => true, |
1942 | | - ), |
1943 | | - ), |
1944 | | - 'indexes' => array( |
1945 | | - 'pr_pagetype' => array( |
1946 | | - 'UNIQUE', 'page', 'type' |
1947 | | - ), |
1948 | | - 'pr_typelevel' => array( |
1949 | | - 'type', 'level' |
1950 | | - ), |
1951 | | - 'pr_level' => array( |
1952 | | - 'level' |
1953 | | - ), |
1954 | | - 'pr_cascade' => array( |
1955 | | - 'cascade' |
1956 | | - ), |
1957 | | - ), |
1958 | | - ), |
1959 | | - 'protected_titles' => array( |
1960 | | - 'prefix' => 'pt', |
1961 | | - 'fields' => array( |
1962 | | - 'namespace' => array( |
1963 | | - 'type' => 'int', |
1964 | | - 'null' => false, |
1965 | | - ), |
1966 | | - 'title' => array( |
1967 | | - 'type' => 'varchar', |
1968 | | - 'length' => 255, |
1969 | | - 'binary' => true, |
1970 | | - 'null' => false, |
1971 | | - ), |
1972 | | - 'namespace' => array( |
1973 | | - 'type' => 'int', |
1974 | | - 'null' => false, |
1975 | | - 'signed' => false, |
1976 | | - ), |
1977 | | - 'reason' => array( |
1978 | | - 'type' => 'blob', |
1979 | | - 'length' => 'tiny', |
1980 | | - ), |
1981 | | - 'timestamp' => array( |
1982 | | - 'type' => 'binary', |
1983 | | - 'length' => 14, |
1984 | | - 'null' => false, |
1985 | | - ), |
1986 | | - 'expiry' => array( |
1987 | | - 'type' => 'datetime', |
1988 | | - 'null' => false, |
1989 | | - 'default' => '', |
1990 | | - ), |
1991 | | - 'create_perm' => array( |
1992 | | - 'type' => 'varbinary', |
1993 | | - 'length' => 60, |
1994 | | - 'null' => false, |
1995 | | - ), |
1996 | | - ), |
1997 | | - 'indexes' => array( |
1998 | | - 'pt_namespace_title' => array( |
1999 | | - 'UNIQUE', 'namespace', 'title' |
2000 | | - ), |
2001 | | - 'pt_timestamp' => array( |
2002 | | - 'timestamp' |
2003 | | - ), |
2004 | | - ), |
2005 | | - ), |
2006 | | - 'page_props' => array( |
2007 | | - 'prefix' => 'pp', |
2008 | | - 'fields' => array( |
2009 | | - 'page' => array( |
2010 | | - 'type' => 'int', |
2011 | | - 'null' => false, |
2012 | | - ), |
2013 | | - 'propname' => array( |
2014 | | - 'type' => 'varbinary', |
2015 | | - 'length' => 60, |
2016 | | - 'null' => false, |
2017 | | - ), |
2018 | | - 'value' => array( |
2019 | | - 'type' => 'blob', |
2020 | | - 'null' => false, |
2021 | | - ), |
2022 | | - ), |
2023 | | - ), |
2024 | | - 'updatelog' => array( |
2025 | | - 'prefix' => 'ul', |
2026 | | - 'fields' => array( |
2027 | | - 'key' => array( |
2028 | | - 'type' => 'varchar', |
2029 | | - 'length' => 255, |
2030 | | - 'null' => false, |
2031 | | - 'primary-key' => true, |
2032 | | - ), |
2033 | | - ), |
2034 | | - ), |
2035 | | - 'change_tag' => array( |
2036 | | - 'prefix' => 'ct', |
2037 | | - 'fields' => array( |
2038 | | - 'rc_id' => array( |
2039 | | - 'type' => 'int', |
2040 | | - 'null' => true, |
2041 | | - ), |
2042 | | - 'log_id' => array( |
2043 | | - 'type' => 'int', |
2044 | | - 'null' => true, |
2045 | | - ), |
2046 | | - 'rev_id' => array( |
2047 | | - 'type' => 'int', |
2048 | | - 'null' => true, |
2049 | | - ), |
2050 | | - 'tag' => array( |
2051 | | - 'type' => 'varchar', |
2052 | | - 'length' => 255, |
2053 | | - 'null' => false, |
2054 | | - ), |
2055 | | - 'params' => array( |
2056 | | - 'type' => 'blob', |
2057 | | - 'null' => true, |
2058 | | - ), |
2059 | | - ), |
2060 | | - 'indexes' => array( |
2061 | | - 'change_tag_rc_tag' => array( |
2062 | | - 'UNIQUE', 'rc_id', 'tag' |
2063 | | - ), |
2064 | | - 'change_tag_log_tag' => array( |
2065 | | - 'UNIQUE', 'log_id', 'tag' |
2066 | | - ), |
2067 | | - 'change_tag_rev_tag' => array( |
2068 | | - 'UNIQUE', 'rev_id', 'tag' |
2069 | | - ), |
2070 | | - 'change_tag_tag_id' => array( |
2071 | | - 'tag', 'rc_id', 'rev_id', 'log_id' |
2072 | | - ), |
2073 | | - ), |
2074 | | - ), |
2075 | | - 'tag_summary' => array( |
2076 | | - 'prefix' => 'ts', |
2077 | | - 'fields' => array( |
2078 | | - 'rc_id' => array( |
2079 | | - 'type' => 'int', |
2080 | | - 'null' => true, |
2081 | | - ), |
2082 | | - 'log_id' => array( |
2083 | | - 'type' => 'int', |
2084 | | - 'null' => true, |
2085 | | - ), |
2086 | | - 'rev_id' => array( |
2087 | | - 'type' => 'int', |
2088 | | - 'null' => true, |
2089 | | - ), |
2090 | | - 'tags' => array( |
2091 | | - 'type' => 'blob', |
2092 | | - 'null' => false, |
2093 | | - ), |
2094 | | - ), |
2095 | | - 'indexes' => array( |
2096 | | - 'tag_summary_rc_id' => array( |
2097 | | - 'UNIQUE', 'rc_id' |
2098 | | - ), |
2099 | | - 'tag_summary_log_id' => array( |
2100 | | - 'UNIQUE', 'log_id' |
2101 | | - ), |
2102 | | - 'tag_summary_rev_id' => array( |
2103 | | - 'UNIQUE', 'rev_id' |
2104 | | - ), |
2105 | | - ), |
2106 | | - ), |
2107 | | - 'valid_tag' => array( |
2108 | | - 'prefix' => 'vt', |
2109 | | - 'fields' => array( |
2110 | | - 'tag' => array( |
2111 | | - 'type' => 'varchar', |
2112 | | - 'length' => 255, |
2113 | | - 'null' => false, |
2114 | | - 'primary-key' => true, |
2115 | | - ), |
2116 | | - ), |
2117 | | - ), |
2118 | | - 'l10n_cache' => array( |
2119 | | - 'prefix' => 'lc', |
2120 | | - 'fields' => array( |
2121 | | - 'lang' => array( |
2122 | | - 'type' => 'varbinary', |
2123 | | - 'length' => 32, |
2124 | | - 'null' => false, |
2125 | | - ), |
2126 | | - 'key' => array( |
2127 | | - 'type' => 'varchar', |
2128 | | - 'length' => 255, |
2129 | | - 'null' => false, |
2130 | | - ), |
2131 | | - 'value' => array( |
2132 | | - 'type' => 'blob', |
2133 | | - 'length' => 'medium', |
2134 | | - 'null' => false, |
2135 | | - ), |
2136 | | - ), |
2137 | | - 'indexes' => array( |
2138 | | - 'lc_lang_key' => array( |
2139 | | - 'lang', 'key' |
2140 | | - ) |
2141 | | - ), |
2142 | | - ), |
2143 | | - ); |
2144 | | - |
2145 | | - /** |
2146 | | - * Extra tables that aren't strictly necessary, mostly use |
2147 | | - * by developers |
2148 | | - */ |
2149 | | - public static $optionalTables = array( |
2150 | | - 'profiling' => array( |
2151 | | - 'prefix' => 'pf', |
2152 | | - 'fields' => array( |
2153 | | - 'count' => array( |
2154 | | - 'type' => 'int', |
2155 | | - 'null' => false, |
2156 | | - 'default' => 0, |
2157 | | - ), |
2158 | | - 'time' => array( |
2159 | | - 'type' => 'float', |
2160 | | - 'null' => false, |
2161 | | - 'default' => 0, |
2162 | | - ), |
2163 | | - 'memory' => array( |
2164 | | - 'type' => 'float', |
2165 | | - 'null' => false, |
2166 | | - 'default' => 0, |
2167 | | - ), |
2168 | | - 'name' => array( |
2169 | | - 'type' => 'varchar', |
2170 | | - 'length' => 255, |
2171 | | - 'null' => false, |
2172 | | - 'default' => '', |
2173 | | - ), |
2174 | | - 'server' => array( |
2175 | | - 'type' => 'varchar', |
2176 | | - 'length' => 30, |
2177 | | - 'null' => false, |
2178 | | - 'default' => '', |
2179 | | - ), |
2180 | | - ), |
2181 | | - 'indexes' => array( |
2182 | | - 'pf_name_server' => array( |
2183 | | - 'UNIQUE', 'name', 'server' |
2184 | | - ), |
2185 | | - ), |
2186 | | - ), |
2187 | | - 'testrun' => array( |
2188 | | - 'prefix' => 'tr', |
2189 | | - 'fields' => array( |
2190 | | - 'id' => array( |
2191 | | - 'type' => 'int', |
2192 | | - 'null' => false, |
2193 | | - 'auto-increment' => true, |
2194 | | - 'primary-key' => true, |
2195 | | - ), |
2196 | | - 'date' => array( |
2197 | | - 'type' => 'char', |
2198 | | - 'length' => 14, |
2199 | | - 'binary' => true, |
2200 | | - ), |
2201 | | - 'mw_version' => array( |
2202 | | - 'type' => 'blob', |
2203 | | - ), |
2204 | | - 'php_version' => array( |
2205 | | - 'type' => 'blob', |
2206 | | - ), |
2207 | | - 'db_version' => array( |
2208 | | - 'type' => 'blob', |
2209 | | - ), |
2210 | | - 'uname' => array( |
2211 | | - 'type' => 'blob', |
2212 | | - ), |
2213 | | - ), |
2214 | | - ), |
2215 | | - 'testitem' => array( |
2216 | | - 'prefix' => 'ti', |
2217 | | - 'fields' => array( |
2218 | | - 'run' => array( |
2219 | | - 'type' => 'int', |
2220 | | - 'null' => false, |
2221 | | - ), |
2222 | | - 'run' => array( |
2223 | | - 'type' => 'int', |
2224 | | - 'null' => false, |
2225 | | - ), |
2226 | | - 'success' => array( |
2227 | | - 'type' => 'bool', |
2228 | | - ) |
2229 | | - ), |
2230 | | - ), |
2231 | | - ); |
2232 | | -} |
Index: branches/new-installer/phase3/includes/db/SchemaBuilder.php |
— | — | @@ -1,164 +0,0 @@ |
2 | | -<?php |
3 | | -/** |
4 | | - * SchemaBuilder - Uses definition in Schema.php to create a DBMS-specific |
5 | | - * schema for MediaWiki |
6 | | - * |
7 | | - * This program is free software; you can redistribute it and/or modify |
8 | | - * it under the terms of the GNU General Public License as published by |
9 | | - * the Free Software Foundation; either version 2 of the License, or |
10 | | - * (at your option) any later version. |
11 | | - * |
12 | | - * This program is distributed in the hope that it will be useful, |
13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | | - * GNU General Public License for more details. |
16 | | - * |
17 | | - * You should have received a copy of the GNU General Public License |
18 | | - * along with this program; if not, write to the Free Software |
19 | | - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
20 | | - * |
21 | | - * @author Chad Horohoe <chad@anyonecanedit.org> |
22 | | - * @todo Handle lengths on indexes, eg: el_from, el_to(40) |
23 | | - * @toto Handle REFERENCES/ON DELETE CASCADE |
24 | | - */ |
25 | | -abstract class SchemaBuilder { |
26 | | - // Final SQL to be output |
27 | | - private $outputSql = ''; |
28 | | - |
29 | | - // If at any point we fail, set this to false |
30 | | - protected $isOk = true; |
31 | | - |
32 | | - // The prefix used for all tables |
33 | | - protected $tblPrefix = ''; |
34 | | - |
35 | | - // Any options for the table creation. Things like ENGINE=InnoDB |
36 | | - protected $tblOptions = array(); |
37 | | - |
38 | | - /** |
39 | | - * Pieces accessible to extensions |
40 | | - */ |
41 | | - |
42 | | - // Our table definition |
43 | | - public $tables = array(); |
44 | | - |
45 | | - // Old tables that should be deleted if they're still present |
46 | | - public $tablesToDelete = array(); |
47 | | - |
48 | | - /** |
49 | | - * End externally-visible fields |
50 | | - */ |
51 | | - |
52 | | - /** |
53 | | - * Constructor. We hide it so people don't try to construct their own schema |
54 | | - * classes. Use a sane entry point, like newFromType() |
55 | | - * |
56 | | - * @param $schema Array See Schema::$defaultTables for more information |
57 | | - */ |
58 | | - private final function __construct( $schema ) { |
59 | | - wfRunHooks( 'LoadExtensionSchemaUpdates', array( $this ) ); |
60 | | - $this->tables = $schema; |
61 | | - $this->adjustTablesForDatabase(); |
62 | | - } |
63 | | - |
64 | | - /** |
65 | | - * Get a brand new Mediawiki schema for a given DB type |
66 | | - * |
67 | | - * @param $type String A database type (eg: mysql, postgres, sqlite) |
68 | | - * @return SchemaBuilder subclass |
69 | | - */ |
70 | | - public static function newFromType( $type ) { |
71 | | - $class = 'Schema' . ucfirst( strtolower( $type ) ); |
72 | | - if ( !class_exists( $class ) ) { |
73 | | - throw new Exception( "No such database class $class" ); |
74 | | - } else { |
75 | | - return new $class( Schema::$defaultTables ); |
76 | | - } |
77 | | - } |
78 | | - |
79 | | - /** |
80 | | - * Top-level create method. Loops the tables and passes them to the child |
81 | | - * classes for implementation |
82 | | - * |
83 | | - * @return boolean |
84 | | - */ |
85 | | - public function createAllTables() { |
86 | | - foreach( $this->tables as $name => $definition ) { |
87 | | - $this->outputSql .= $this->createTable( $name, $definition ); |
88 | | - } |
89 | | - return $this->isOk; |
90 | | - } |
91 | | - |
92 | | - /** |
93 | | - * Similar to generateTables(), but only generates SQL for tables that do not exist |
94 | | - * |
95 | | - * @param $db Database object |
96 | | - * @return boolean |
97 | | - */ |
98 | | - public function updateAllTables( DatabaseBase $db ) { |
99 | | - $this->setTablePrefix( $db->tablePrefix() ); |
100 | | - foreach( $this->tables as $name => $definition ) { |
101 | | - if( $db->tableExists( $name ) ) { |
102 | | - $this->outputSql .= $this->updateTable( $name, $definition, $db ); |
103 | | - } else { |
104 | | - $this->outputSql .= $this->createTable( $name, $definition ); |
105 | | - } |
106 | | - } |
107 | | - return $this->isOk; |
108 | | - } |
109 | | - |
110 | | - /** |
111 | | - * Get the final DBMS-specific SQL |
112 | | - * |
113 | | - * @return string |
114 | | - */ |
115 | | - public function getSql() { |
116 | | - return $this->outputSql; |
117 | | - } |
118 | | - |
119 | | - /** |
120 | | - * Set the prefix for all tables, usually $wgDBprefix |
121 | | - * |
122 | | - * @param $prefix String The prefix to use for all table names |
123 | | - */ |
124 | | - public function setTablePrefix( $prefix ) { |
125 | | - $this->tblPrefix = $prefix; |
126 | | - } |
127 | | - |
128 | | - /** |
129 | | - * Set the default table options for all tables |
130 | | - * @param $opts Array of table options, like 'engine' => 'InnoDB', etc |
131 | | - */ |
132 | | - public function setTableOptions( $opts ) { |
133 | | - $this->tblOptions = $opts; |
134 | | - } |
135 | | - |
136 | | - /** |
137 | | - * Returns database type |
138 | | - */ |
139 | | - abstract public function getType(); |
140 | | - |
141 | | - /** |
142 | | - * Given an abstract table definition, return a DBMS-specific command to |
143 | | - * create it. |
144 | | - * @param $name The name of the table, like 'page' or 'revision' |
145 | | - * @param $definition Array An abstract table definition |
146 | | - * @return String |
147 | | - */ |
148 | | - abstract protected function createTable( $name, $definition ); |
149 | | - |
150 | | - /** |
151 | | - * Given an abstract table definition, check the current table and see if |
152 | | - * it needs updating, returning appropriate update queries as needed. |
153 | | - * @param $name The name of the table, like 'page' or 'revision' |
154 | | - * @param $definition Array An abstract table definition |
155 | | - * @param $db DatabaseBase object, referring to current wiki DB |
156 | | - * @return String |
157 | | - */ |
158 | | - abstract protected function updateTable( $name, $definition, $db ); |
159 | | - |
160 | | - /** |
161 | | - * Makes database-specific changes to the schema. No-op by default. |
162 | | - * @return Nothing |
163 | | - */ |
164 | | - protected function adjustTablesForDatabase() {} |
165 | | -} |
Index: branches/new-installer/phase3/includes/db/SchemaSqlite.php |
— | — | @@ -1,129 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -class SchemaSqlite extends SchemaBuilder { |
5 | | - static $typeMapping = array( |
6 | | - 'int' => 'INTEGER', |
7 | | - 'varchar' => 'TEXT', |
8 | | - 'datetime' => 'TEXT', |
9 | | - 'text' => 'TEXT', |
10 | | - 'blob' => 'BLOB', |
11 | | - 'binary' => 'BLOB', |
12 | | - 'varbinary' => 'BLOB', |
13 | | - 'bool' => 'INTEGER', |
14 | | - 'enum' => 'BLOB', |
15 | | - 'float' => 'REAL', |
16 | | - 'real' => 'REAL', |
17 | | - 'char' => 'TEXT', |
18 | | - 'none' => '', |
19 | | - ); |
20 | | - |
21 | | - public function getType() { |
22 | | - return 'sqlite'; |
23 | | - } |
24 | | - |
25 | | - /** |
26 | | - * @todo: update updatelog with fts3 |
27 | | - */ |
28 | | - protected function adjustTablesForDatabase() { |
29 | | - $db = new DatabaseSqliteStandalone( ':memory:' ); |
30 | | - if ( $db->getFulltextSearchModule() == 'FTS3' ) { |
31 | | - $this->tables['searchindex'] = array( |
32 | | - 'prefix' => 'si', |
33 | | - 'virtual' => 'FTS3', |
34 | | - 'fields' => array( |
35 | | - 'title' => array( |
36 | | - 'type' => 'none', |
37 | | - ), |
38 | | - 'text' => array( |
39 | | - 'type' => 'none', |
40 | | - ), |
41 | | - ) |
42 | | - ); |
43 | | - } else { |
44 | | - $this->tables['searchindex'] = array( |
45 | | - 'prefix' => 'si', |
46 | | - 'fields' => array( |
47 | | - 'title' => array( |
48 | | - 'type' => 'text', |
49 | | - ), |
50 | | - 'text' => array( |
51 | | - 'type' => 'text', |
52 | | - ), |
53 | | - ) |
54 | | - ); |
55 | | - $this->tablesToDelete = array_merge( $this->tablesToDelete, |
56 | | - array( 'searchindex_content', 'searchindex_segdir', 'searchindex_segments' ) |
57 | | - ); |
58 | | - } |
59 | | - $db->close(); |
60 | | - } |
61 | | - |
62 | | - protected function createTable( $name, $def ) { |
63 | | - $prefix = $def['prefix'] ? $def['prefix'] . '_' : ''; |
64 | | - $tblName = $this->tblPrefix . $name; |
65 | | - $virtual = isset ( $def['virtual'] ) ? $def['virtual'] : false; |
66 | | - if ( $virtual ) { |
67 | | - $sql = "CREATE VIRTUAL TABLE `$tblName` USING $virtual ("; |
68 | | - } else { |
69 | | - $sql = "CREATE TABLE `$tblName` ("; |
70 | | - } |
71 | | - foreach( $def['fields'] as $field => $attribs ) { |
72 | | - $sql .= "\n\t{$prefix}{$field} " . $this->getFieldDefinition( $attribs ); |
73 | | - } |
74 | | - $sql = rtrim( $sql, ',' ); |
75 | | - $sql .= "\n);\n"; |
76 | | - if( isset( $def['indexes'] ) ) { |
77 | | - foreach( $def['indexes'] as $idx => $idxDef ) { |
78 | | - if( $idxDef[0] === 'UNIQUE' ) { |
79 | | - array_shift( $idxDef ); |
80 | | - $sql .= "CREATE UNIQUE INDEX "; |
81 | | - } elseif( $idxDef[0] == 'FULLTEXT' ) { |
82 | | - continue; // no thanks |
83 | | - } else { |
84 | | - $sql .= "CREATE INDEX "; |
85 | | - } |
86 | | - $sql .= "{$this->tblPrefix}{$idx} ON $tblName ("; |
87 | | - foreach( $idxDef as $col ) { |
88 | | - $sql .= "{$prefix}{$col}, "; |
89 | | - } |
90 | | - $sql = rtrim( $sql, ', ' ); |
91 | | - $sql .= ");\n"; |
92 | | - } |
93 | | - } |
94 | | - return $sql . "\n"; |
95 | | - } |
96 | | - |
97 | | - /** |
98 | | - * Given an abstract field definition, return a MySQL-specific definition. |
99 | | - * @param $attribs Array An abstract table definition |
100 | | - * @return String |
101 | | - */ |
102 | | - private function getFieldDefinition( $attribs ) { |
103 | | - $type = $attribs['type']; |
104 | | - if ( !isset( self::$typeMapping[$type] ) ) { |
105 | | - throw new MWException( "Unknown type $type" ); |
106 | | - } |
107 | | - $def = self::$typeMapping[$type]; |
108 | | - if( isset( $attribs['null'] ) ) { |
109 | | - $def .= $attribs['null'] ? ' NULL' : ' NOT NULL'; |
110 | | - } |
111 | | - // Use array_key_exists() since 'default' might be set to null |
112 | | - if( array_key_exists( 'default', $attribs ) ) { |
113 | | - if( $attribs['default'] === null ) { |
114 | | - $def .= ' default NULL'; |
115 | | - } else { |
116 | | - $def .= " DEFAULT '" . $attribs['default'] . "'"; |
117 | | - } |
118 | | - } if( isset( $attribs['primary-key'] ) && $attribs['primary-key'] ) { |
119 | | - $def .= ' PRIMARY KEY'; |
120 | | - } |
121 | | - if( isset( $attribs['auto-increment'] ) && $attribs['auto-increment'] ) { |
122 | | - $def .= ' AUTOINCREMENT'; |
123 | | - } |
124 | | - return $def . ','; |
125 | | - } |
126 | | - |
127 | | - protected function updateTable( $name, $definition, $db ) { |
128 | | - return ''; |
129 | | - } |
130 | | -} |
Index: branches/new-installer/phase3/includes/db/SchemaMysql.php |
— | — | @@ -1,229 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -class SchemaMysql extends SchemaBuilder { |
5 | | - /** |
6 | | - * BLOB or TEXT fields on MySQL require a length to be specified in |
7 | | - * index declarations, otherwise CREATE INDEX will fail with error 1170. |
8 | | - */ |
9 | | - var $indexLengths = array( |
10 | | - 'el_from' => array( |
11 | | - 'el_to' => 40, |
12 | | - ), |
13 | | - 'el_to' => array( |
14 | | - 'el_to' => 60, |
15 | | - ), |
16 | | - 'el_index' => array( |
17 | | - 'el_index' => 60, |
18 | | - ), |
19 | | - 'ipb_address' => array( |
20 | | - 'ipb_address' => 255, |
21 | | - ), |
22 | | - 'ipb_range' => array( |
23 | | - 'ipb_range_start' => 8, |
24 | | - 'ipb_range_end' => 8, |
25 | | - ), |
26 | | - 'oi_name_archive_name' => array( |
27 | | - 'oi_name_archive_name' => 14, |
28 | | - ), |
29 | | - 'job_cmd' => array( |
30 | | - 'job_params' => 128, |
31 | | - ), |
32 | | - ); |
33 | | - |
34 | | - public function getType() { |
35 | | - return 'mysql'; |
36 | | - } |
37 | | - |
38 | | - protected function adjustTablesForDatabase() { |
39 | | - $this->tables['searchindex'] = array( |
40 | | - 'prefix' => 'si', |
41 | | - 'fields' => array( |
42 | | - 'page' => array( |
43 | | - 'type' => 'int', |
44 | | - 'signed' => false, |
45 | | - 'null' => false, |
46 | | - ), |
47 | | - 'title' => array( |
48 | | - 'type' => 'varchar', |
49 | | - 'length' => 255, |
50 | | - 'null' => false, |
51 | | - 'default' => '', |
52 | | - ), |
53 | | - 'text' => array( |
54 | | - 'type' => 'text', |
55 | | - 'length' => 'medium', |
56 | | - 'null' => false, |
57 | | - ), |
58 | | - ), |
59 | | - 'indexes' => array( |
60 | | - 'si_page' => array( |
61 | | - 'UNIQUE', 'page', |
62 | | - ), |
63 | | - 'si_title' => array( |
64 | | - 'FULLTEXT', 'title', |
65 | | - ), |
66 | | - 'si_text' => array( |
67 | | - 'FULLTEXT', 'text', |
68 | | - ), |
69 | | - ), |
70 | | - 'options' => array( |
71 | | - 'engine' => 'MyISAM', |
72 | | - ), |
73 | | - ); |
74 | | - |
75 | | - $this->tables['revision']['options'] = array( |
76 | | - 'max_rows' => 10000000, |
77 | | - 'avg_row_length' => 1024, |
78 | | - ); |
79 | | - |
80 | | - $this->tables['text']['options'] = array( |
81 | | - 'max_rows' => 10000000, |
82 | | - 'avg_row_length' => 10240, |
83 | | - ); |
84 | | - |
85 | | - $this->tables['hitcounter']['options'] = array( |
86 | | - 'max_rows' => 25000, |
87 | | - 'engine' => 'HEAP', |
88 | | - ); |
89 | | - } |
90 | | - |
91 | | - /** |
92 | | - * @see SchemaBuilder::createTable() |
93 | | - */ |
94 | | - protected function createTable( $name, $def ) { |
95 | | - $prefix = $def['prefix'] ? $def['prefix'] . '_' : ''; |
96 | | - $tblName = $this->tblPrefix . $name; |
97 | | - $opts = isset( $def['options'] ) ? $def['options'] : array(); |
98 | | - $sql = "CREATE TABLE `$tblName` ("; |
99 | | - foreach( $def['fields'] as $field => $attribs ) { |
100 | | - $sql .= "\n\t{$prefix}{$field} " . $this->getFieldDefinition( $attribs ); |
101 | | - } |
102 | | - $sql = rtrim( $sql, ',' ); |
103 | | - $sql .= "\n) " . $this->getTableOptions( $opts ) . ";\n"; |
104 | | - if( isset( $def['indexes'] ) ) { |
105 | | - foreach( $def['indexes'] as $idx => $idxDef ) { |
106 | | - if( $idxDef[0] === 'UNIQUE' ) { |
107 | | - array_shift( $idxDef ); |
108 | | - $sql .= "CREATE UNIQUE INDEX "; |
109 | | - } elseif( $idxDef[0] == 'FULLTEXT' ) { |
110 | | - array_shift( $idxDef ); |
111 | | - $sql .= "CREATE FULLTEXT INDEX "; |
112 | | - } else { |
113 | | - $sql .= "CREATE INDEX "; |
114 | | - } |
115 | | - $sql .= "{$this->tblPrefix}{$idx} ON $tblName ("; |
116 | | - foreach( $idxDef as $col ) { |
117 | | - $field = "{$prefix}{$col}"; |
118 | | - if ( isset( $this->indexLengths[$idx] ) && isset( $this->indexLengths[$idx][$field] ) ) { |
119 | | - $field .= "({$this->indexLengths[$idx][$field]})"; |
120 | | - } |
121 | | - $sql .= "$field, "; |
122 | | - } |
123 | | - $sql = rtrim( $sql, ', ' ); |
124 | | - $sql .= ");\n"; |
125 | | - } |
126 | | - } |
127 | | - return $sql . "\n"; |
128 | | - } |
129 | | - |
130 | | - /** |
131 | | - * Given an abstract field definition, return a MySQL-specific definition. |
132 | | - * @param $attribs Array An abstract table definition |
133 | | - * @return String |
134 | | - */ |
135 | | - private function getFieldDefinition( $attribs ) { |
136 | | - if( !isset( $attribs['type'] ) ) { |
137 | | - $this->isOk = false; |
138 | | - throw new Exception( "No type specified for field" ); |
139 | | - } |
140 | | - $fieldType = $attribs['type']; |
141 | | - $def = ''; |
142 | | - switch( $fieldType ) { |
143 | | - case 'int': |
144 | | - $def = 'int'; |
145 | | - if( isset( $attribs['length'] ) ) { |
146 | | - $def = $attribs['length'] . $def; |
147 | | - } |
148 | | - break; |
149 | | - case 'varchar': |
150 | | - $def = 'varchar(' . $attribs['length'] . ')'; |
151 | | - break; |
152 | | - case 'char': |
153 | | - $def = 'char(' . $attribs['length'] . ')'; |
154 | | - break; |
155 | | - case 'datetime': |
156 | | - $def = 'binary(14)'; |
157 | | - break; |
158 | | - case 'text': |
159 | | - $def = 'text'; |
160 | | - if( isset( $attribs['length'] ) ) { |
161 | | - $def = $attribs['length'] . $def; |
162 | | - } |
163 | | - break; |
164 | | - case 'blob': |
165 | | - $def = 'blob'; |
166 | | - if( isset( $attribs['length'] ) ) { |
167 | | - $def = $attribs['length'] . $def; |
168 | | - } |
169 | | - break; |
170 | | - case 'binary': |
171 | | - $def = 'binary(' . $attribs['length'] . ')'; |
172 | | - break; |
173 | | - case 'varbinary': |
174 | | - $def = 'varbinary(' . $attribs['length'] . ')'; |
175 | | - break; |
176 | | - case 'bool': |
177 | | - $def = 'bool'; |
178 | | - break; |
179 | | - case 'enum': |
180 | | - $def = 'ENUM("' . implode( '", "', $attribs['values'] ); |
181 | | - $def = rtrim( $def, ', "' ) . '")'; |
182 | | - break; |
183 | | - case 'float': |
184 | | - $def = 'float'; |
185 | | - break; |
186 | | - case 'real': |
187 | | - $def = 'real'; |
188 | | - break; |
189 | | - default: |
190 | | - $this->isOk = false; |
191 | | - } |
192 | | - if( isset( $attribs['signed'] ) ) { |
193 | | - $def .= $attribs['signed'] ? ' signed' : ' unsigned'; |
194 | | - } |
195 | | - if( isset( $attribs['binary'] ) && $attribs['binary'] ) { |
196 | | - $def = $def . ' binary'; |
197 | | - } |
198 | | - if( isset( $attribs['null'] ) ) { |
199 | | - $def .= $attribs['null'] ? ' NULL' : ' NOT NULL'; |
200 | | - } |
201 | | - // Use array_key_exists() since 'default' might be set to null |
202 | | - if( array_key_exists( 'default', $attribs ) ) { |
203 | | - if( $attribs['default'] === null ) { |
204 | | - $def .= ' default NULL'; |
205 | | - } else { |
206 | | - $def .= " default '" . $attribs['default'] . "'"; |
207 | | - } |
208 | | - } |
209 | | - if( isset( $attribs['primary-key'] ) && $attribs['primary-key'] ) { |
210 | | - $def .= " PRIMARY KEY"; |
211 | | - } |
212 | | - if( isset( $attribs['auto-increment'] ) && $attribs['auto-increment'] ) { |
213 | | - $def .= " AUTO_INCREMENT"; |
214 | | - } |
215 | | - return $def . ","; |
216 | | - } |
217 | | - |
218 | | - private function getTableOptions( $opts ) { |
219 | | - $opts = array_merge( $this->tblOptions, $opts ); |
220 | | - $ret = array(); |
221 | | - foreach( $opts as $name => $value ) { |
222 | | - $ret[] = strtoupper( $name ) . "=$value"; |
223 | | - } |
224 | | - return implode( ', ', $ret ); |
225 | | - } |
226 | | - |
227 | | - protected function updateTable( $name, $definition, $db ) { |
228 | | - return ''; |
229 | | - } |
230 | | -} |
Index: branches/new-installer/phase3/includes/db/SchemaOracle.php |
— | — | @@ -1,86 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -class SchemaOracle extends SchemaBuilder { |
5 | | - |
6 | | - public function getType() { |
7 | | - return 'oracle'; |
8 | | - } |
9 | | - |
10 | | - protected function adjustTablesForDatabase() { |
11 | | - $this->tables['searchindex'] = array( |
12 | | - 'prefix' => 'si', |
13 | | - 'fields' => array( |
14 | | - 'page' => array( |
15 | | - 'type' => 'int', |
16 | | - 'null' => false, |
17 | | - ), |
18 | | - 'title' => array( |
19 | | - 'type' => 'varchar', |
20 | | - 'length' => 255, |
21 | | - 'null' => false, |
22 | | - 'default' => '', |
23 | | - ), |
24 | | - 'text' => array( |
25 | | - 'type' => 'text', |
26 | | - 'null' => false, |
27 | | - ), |
28 | | - ), |
29 | | - 'indexes' => array( |
30 | | - 'si_page' => array( |
31 | | - 'UNIQUE', 'page', |
32 | | - ), |
33 | | - 'si_title' => array( |
34 | | - 'CTXSYS.CONTEXT', 'title', |
35 | | - ), |
36 | | - 'si_text' => array( |
37 | | - 'CTXSYS.CONTEXT', 'text', |
38 | | - ), |
39 | | - ), |
40 | | - ); |
41 | | - } |
42 | | - |
43 | | - protected function createTable( $name, $def ) { |
44 | | -$prefix = $def['prefix'] ? $def['prefix'] . '_' : ''; |
45 | | -$tblName = $this->tblPrefix . $name; |
46 | | - |
47 | | -$sql = "CREATE TABLE $tblName ("; |
48 | | -foreach( $def['fields'] as $field => $attribs ) { |
49 | | -$sql .= "\n\t{$prefix}{$field} " . $this->getFieldDefinition( $attribs ); |
50 | | -} |
51 | | -$sql = rtrim( $sql, ',' ); |
52 | | -$sql .= ");\n"; |
53 | | - |
54 | | - $idx_i = 0; |
55 | | - $idx_u = 0; |
56 | | -if( isset( $def['indexes'] ) ) { |
57 | | -foreach( $def['indexes'] as $idx => $idxDef ) { |
58 | | -$idxType = ''; |
59 | | -if (isset($idxDef[1])) { |
60 | | - $idxType = array_shift( $idxDef ); |
61 | | - } |
62 | | - |
63 | | -if( $idxType === 'UNIQUE' ) { |
64 | | -$sql .= "CREATE UNIQUE INDEX {$tblName}_u". |
65 | | - str_pad(++$idx_u, 2, "0", STR_PAD_LEFT). |
66 | | - " ON {$tblName} ("; |
67 | | -} elseif ($idxType !== '') { |
68 | | -$sql .= "CREATE INDEX {$this->tblPrefix}{$idx} ON {$tblName} ("; |
69 | | -} else { |
70 | | -$sql .= "CREATE INDEX {$tblName}_u". |
71 | | - str_pad(++$idx_i, 2, "0", STR_PAD_LEFT). |
72 | | - " ON {$tblName} ("; |
73 | | - } |
74 | | - |
75 | | -foreach( $idxDef as $col ) { |
76 | | -$sql .= "{$prefix}{$col}, "; |
77 | | -} |
78 | | -$sql = rtrim( $sql, ', ' ); |
79 | | -$sql .= ");\n"; |
80 | | -} |
81 | | -} |
82 | | -return $sql . "\n"; |
83 | | -} |
84 | | - |
85 | | - protected function updateTable( $name, $definition, $db ) {} |
86 | | - |
87 | | -} |
Index: branches/new-installer/phase3/includes/db/DatabaseSqlite.php |
— | — | @@ -476,32 +476,6 @@ |
477 | 477 | public function getLag() { |
478 | 478 | return 0; |
479 | 479 | } |
480 | | - |
481 | | - /** |
482 | | - * Called by the installer script (when modified according to the MediaWikiLite installation instructions) |
483 | | - * - this is the same way PostgreSQL works, MySQL reads in tables.sql and interwiki.sql using dbsource (which calls db->sourceFile) |
484 | | - */ |
485 | | - public function setup_database() { |
486 | | - global $IP; |
487 | | - |
488 | | - # Process common MySQL/SQLite table definitions |
489 | | - $err = $this->sourceFile( "$IP/maintenance/tables.sql" ); |
490 | | - if ( $err !== true ) { |
491 | | - $this->reportQueryError( $err, 0, $sql, __FUNCTION__ ); |
492 | | - exit( 1 ); |
493 | | - } |
494 | | - |
495 | | - # Use DatabasePostgres's code to populate interwiki from MySQL template |
496 | | - $f = fopen( "$IP/maintenance/interwiki.sql", 'r' ); |
497 | | - if ( $f == false ) dieout( "<li>Could not find the interwiki.sql file" ); |
498 | | - $sql = "INSERT INTO interwiki(iw_prefix,iw_url,iw_local) VALUES "; |
499 | | - while ( !feof( $f ) ) { |
500 | | - $line = fgets( $f, 1024 ); |
501 | | - $matches = array(); |
502 | | - if ( !preg_match( '/^\s*(\(.+?),(\d)\)/', $line, $matches ) ) continue; |
503 | | - $this->query( "$sql $matches[1],$matches[2])" ); |
504 | | - } |
505 | | - } |
506 | 480 | |
507 | 481 | public function getSearchEngine() { |
508 | 482 | return "SearchSqlite"; |
Index: branches/new-installer/phase3/includes/installer/WebInstaller.php |
— | — | @@ -1526,25 +1526,9 @@ |
1527 | 1527 | } |
1528 | 1528 | $this->endStage(); |
1529 | 1529 | |
1530 | | - // Generate schema |
1531 | | - $this->startStage( 'config-install-schema' ); |
1532 | | - $schema = SchemaBuilder::newFromType( $dbType ); |
1533 | | - $schema->setTableOptions( $installer->getTableOptions() ); |
1534 | | - $schema->setTablePrefix( $this->getVar( 'wgDBprefix' ) ); |
1535 | | - if( !$schema->createAllTables() ) { |
1536 | | - // @todo Need some sort of failure |
1537 | | - return; |
1538 | | - } |
1539 | | - $this->endStage(); |
1540 | | - |
1541 | 1530 | // Create tables |
1542 | 1531 | $this->startStage( 'config-install-tables' ); |
1543 | | - $queries = explode( ";", trim( $schema->getSql() ) ); |
1544 | | - foreach( $queries as $qry ) { |
1545 | | - if ( strlen( $qry ) ) { // empty string is an invalid query |
1546 | | - $db->query( $qry, __METHOD__ ); |
1547 | | - } |
1548 | | - } |
| 1532 | + $this->parent->createTables(); |
1549 | 1533 | $this->endStage(); |
1550 | 1534 | |
1551 | 1535 | $this->startStage( 'config-install-secretkey' ); |
Index: branches/new-installer/phase3/includes/installer/Installer.php |
— | — | @@ -236,8 +236,12 @@ |
237 | 237 | |
238 | 238 | /** |
239 | 239 | * Get an instance of InstallerDBType for the specified DB type |
| 240 | + * @param $type Mixed: DB installer for which is needed, false to use default |
240 | 241 | */ |
241 | | - function getDBInstaller( $type ) { |
| 242 | + function getDBInstaller( $type = false ) { |
| 243 | + if ( !$type ) { |
| 244 | + $type = $this->getVar( 'wgDBtype' ); |
| 245 | + } |
242 | 246 | if ( !isset( $this->dbInstallers[$type] ) ) { |
243 | 247 | $class = ucfirst( $type ). 'Installer'; |
244 | 248 | $this->dbInstallers[$type] = new $class( $this ); |
— | — | @@ -727,6 +731,11 @@ |
728 | 732 | $this->setVar( '_Extensions', $exts ); |
729 | 733 | return $exts; |
730 | 734 | } |
| 735 | + |
| 736 | + public function createTables() { |
| 737 | + $installer = $this->getDBInstaller(); |
| 738 | + $installer->createTables(); |
| 739 | + } |
731 | 740 | } |
732 | 741 | |
733 | 742 | /** |
Index: branches/new-installer/phase3/includes/installer/SqliteInstaller.php |
— | — | @@ -78,8 +78,8 @@ |
79 | 79 | # FIXME: need more sensible constructor parameters, e.g. single associative array |
80 | 80 | # Setting globals kind of sucks |
81 | 81 | $wgSQLiteDataDir = $dir; |
82 | | - $this->conn = new DatabaseSqlite( false, false, false, $dbName ); |
83 | | - return $this->conn; |
| 82 | + $this->db = new DatabaseSqlite( false, false, false, $dbName ); |
| 83 | + $status->value = $this->db; |
84 | 84 | } catch ( DBConnectionError $e ) { |
85 | 85 | $status->fatal( 'config-sqlite-connection-error', $e->getMessage() ); |
86 | 86 | } |
— | — | @@ -124,6 +124,23 @@ |
125 | 125 | return $this->getConnection(); |
126 | 126 | } |
127 | 127 | |
| 128 | + function createTables() { |
| 129 | + global $IP; |
| 130 | + $status = $this->getConnection(); |
| 131 | + if ( !$status->isOK() ) { |
| 132 | + return $status; |
| 133 | + } |
| 134 | + // Process common MySQL/SQLite table definitions |
| 135 | + $err = $this->db->sourceFile( "$IP/maintenance/tables.sql" ); |
| 136 | + if ( $err !== true ) { |
| 137 | + //@todo or...? |
| 138 | + $this->db->reportQueryError( $err, 0, $sql, __FUNCTION__ ); |
| 139 | + } |
| 140 | + //@todo set up searchindex |
| 141 | + // Create default interwikis |
| 142 | + return $this->fillInterwikiTable( $this->db ); |
| 143 | + } |
| 144 | + |
128 | 145 | function getLocalSettings() { |
129 | 146 | $dir = LocalSettings::escapePhpString( $this->getVar( 'wgSQLiteDataDir' ) ); |
130 | 147 | return |
Index: branches/new-installer/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -28,8 +28,6 @@ |
29 | 29 | 'CREATE TEMPORARY TABLES', |
30 | 30 | ); |
31 | 31 | |
32 | | - var $conn; |
33 | | - |
34 | 32 | function getName() { |
35 | 33 | return 'mysql'; |
36 | 34 | } |
— | — | @@ -107,7 +105,7 @@ |
108 | 106 | function getConnection() { |
109 | 107 | $status = Status::newGood(); |
110 | 108 | try { |
111 | | - $this->conn = new DatabaseMysql( |
| 109 | + $this->db = new DatabaseMysql( |
112 | 110 | $this->getVar( 'wgDBserver' ), |
113 | 111 | $this->getVar( '_InstallUser' ), |
114 | 112 | $this->getVar( '_InstallPassword' ), |
— | — | @@ -116,7 +114,7 @@ |
117 | 115 | 0, |
118 | 116 | $this->getVar( 'wgDBprefix' ) |
119 | 117 | ); |
120 | | - $status->value = $this->conn; |
| 118 | + $status->value = $this->db; |
121 | 119 | return $status; |
122 | 120 | } catch ( DBConnectionError $e ) { |
123 | 121 | $status->fatal( 'config-connection-error', $e->getMessage() ); |
— | — | @@ -386,6 +384,10 @@ |
387 | 385 | return $conn; |
388 | 386 | } |
389 | 387 | |
| 388 | + function createTables() { |
| 389 | + |
| 390 | + } |
| 391 | + |
390 | 392 | function getTableOptions() { |
391 | 393 | return array( 'engine' => $this->getVar( '_MysqlEngine' ), |
392 | 394 | 'default charset' => $this->getVar( '_MysqlCharset' ) ); |
Index: branches/new-installer/phase3/includes/installer/InstallerDBType.php |
— | — | @@ -7,6 +7,9 @@ |
8 | 8 | /** The Installer object */ |
9 | 9 | var $parent; |
10 | 10 | |
| 11 | + /* Database connection */ |
| 12 | + var $db; |
| 13 | + |
11 | 14 | /** |
12 | 15 | * Return the internal name, e.g. 'mysql', or 'sqlite' |
13 | 16 | */ |
— | — | @@ -72,6 +75,12 @@ |
73 | 76 | abstract function setupDatabase(); |
74 | 77 | |
75 | 78 | /** |
| 79 | + * Create database tables from scratch |
| 80 | + * @return \type Status |
| 81 | + */ |
| 82 | + abstract function createTables(); |
| 83 | + |
| 84 | + /** |
76 | 85 | * Return any table options to be applied to all tables that don't |
77 | 86 | * override them |
78 | 87 | * @return Array |
— | — | @@ -308,5 +317,26 @@ |
309 | 318 | return Status::newGood(); |
310 | 319 | } |
311 | 320 | |
| 321 | + /** |
| 322 | + * Common function for databases that don't understand the MySQLish syntax of interwiki.sql |
| 323 | + */ |
| 324 | + protected function fillInterwikiTable( $db ) { |
| 325 | + global $IP; |
| 326 | + // Originally from DatabasePostgres |
| 327 | + $f = fopen( "$IP/maintenance/interwiki.sql", 'r' ); |
| 328 | + if ( $f == false ) { |
| 329 | + return Status::newFatal( 'config-install-interwiki-sql' ); |
| 330 | + } |
| 331 | + $table = $db->tableName( 'interwiki' ); |
| 332 | + $sql = "INSERT INTO $table(iw_prefix,iw_url,iw_local) VALUES "; |
| 333 | + while ( !feof( $f ) ) { |
| 334 | + $line = fgets( $f, 1024 ); |
| 335 | + $matches = array(); |
| 336 | + if ( !preg_match( '/^\s*(\(.+?),(\d)\)/', $line, $matches ) ) continue; |
| 337 | + $db->query( "$sql $matches[1],$matches[2])" ); |
| 338 | + } |
| 339 | + return Status::newGood(); |
| 340 | + } |
| 341 | + |
312 | 342 | } |
313 | 343 | |
Index: branches/new-installer/phase3/includes/AutoLoader.php |
— | — | @@ -378,11 +378,6 @@ |
379 | 379 | 'ORAResult' => 'includes/db/DatabaseOracle.php', |
380 | 380 | 'PostgresField' => 'includes/db/DatabasePostgres.php', |
381 | 381 | 'ResultWrapper' => 'includes/db/Database.php', |
382 | | - 'Schema' => 'includes/db/Schema.php', |
383 | | - 'SchemaBuilder' => 'includes/db/SchemaBuilder.php', |
384 | | - 'SchemaMysql' => 'includes/db/SchemaMysql.php', |
385 | | - 'SchemaOracle' => 'includes/db/SchemaOracle.php', |
386 | | - 'SchemaSqlite' => 'includes/db/SchemaSqlite.php', |
387 | 382 | 'SQLiteField' => 'includes/db/DatabaseSqlite.php', |
388 | 383 | 'DatabaseIbm_db2' => 'includes/db/DatabaseIbm_db2.php', |
389 | 384 | 'IBM_DB2Field' => 'includes/db/DatabaseIbm_db2.php', |
Index: branches/new-installer/phase3/languages/messages/MessagesEn.php |
— | — | @@ -4453,8 +4453,8 @@ |
4454 | 4454 | 'config-stage-done' => 'done', |
4455 | 4455 | 'config-install-extensions' => 'Including extensions', |
4456 | 4456 | 'config-install-database' => 'Setting up database', |
4457 | | -'config-install-schema' => 'Generating schema', |
4458 | 4457 | 'config-install-tables' => 'Creating tables', |
| 4458 | +'config-install-interwiki-sql' => 'Could not find file interwiki.sql', |
4459 | 4459 | 'config-install-secretkey' => 'Generating secret key', |
4460 | 4460 | 'config-insecure-secretkey' => 'Warning: Unable to create secure $wgSecretKey. Consider changing it manually.', |
4461 | 4461 | 'config-install-user' => 'Creating administrator user account', |