Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -15,7 +15,7 @@ |
16 | 16 | -- |
17 | 17 | -- |
18 | 18 | -- The MySQL table backend for MediaWiki currently uses |
| 19 | +-- 14-character BINARY or VARBINARY fields to store timestamps. |
19 | 20 | -- The format is YYYYMMDDHHMMSS, which is derived from the |
20 | 21 | -- text format of MySQL's TIMESTAMP fields. |
21 | 22 | -- |
— | — | @@ -49,7 +49,7 @@ |
50 | 50 | -- tables. |
51 | 51 | -- |
52 | 52 | CREATE TABLE /*$wgDBprefix*/user ( |
53 | | - user_id int(5) unsigned NOT NULL auto_increment, |
| 53 | + user_id int unsigned NOT NULL auto_increment, |
54 | 54 | |
55 | 55 | -- Usernames must be unique, must not be in the form of |
56 | 56 | -- an IP address. _Shouldn't_ allow slashes or case |
— | — | @@ -76,7 +76,7 @@ |
77 | 77 | |
78 | 78 | -- Timestamp of the last time when a new password was |
79 | 79 | -- sent, for throttling purposes |
80 | | - user_newpass_time char(14) binary, |
| 80 | + user_newpass_time binary(14), |
81 | 81 | |
82 | 82 | -- Note: email should be restricted, not public info. |
83 | 83 | -- Same with passwords. |
— | — | @@ -90,29 +90,29 @@ |
91 | 91 | -- logs in, logs out, changes preferences, or performs |
92 | 92 | -- some other action requiring HTML cache invalidation |
93 | 93 | -- to ensure that the UI is updated. |
94 | | - user_touched char(14) binary NOT NULL default '', |
| 94 | + user_touched binary(14) NOT NULL default '', |
95 | 95 | |
96 | 96 | -- A pseudorandomly generated value that is stored in |
97 | 97 | -- a cookie when the "remember password" feature is |
98 | 98 | -- used (previously, a hash of the password was used, but |
99 | 99 | -- this was vulnerable to cookie-stealing attacks) |
100 | | - user_token char(32) binary NOT NULL default '', |
| 100 | + user_token binary(32) NOT NULL default '', |
101 | 101 | |
102 | 102 | -- Initially NULL; when a user's e-mail address has been |
103 | 103 | -- validated by returning with a mailed token, this is |
104 | 104 | -- set to the current timestamp. |
105 | | - user_email_authenticated char(14) binary, |
| 105 | + user_email_authenticated binary(14), |
106 | 106 | |
107 | 107 | -- Randomly generated token created when the e-mail address |
108 | 108 | -- is set and a confirmation test mail sent. |
109 | | - user_email_token char(32) binary, |
| 109 | + user_email_token binary(32), |
110 | 110 | |
111 | 111 | -- Expiration date for the user_email_token |
112 | | - user_email_token_expires char(14) binary, |
| 112 | + user_email_token_expires binary(14), |
113 | 113 | |
114 | 114 | -- Timestamp of account registration. |
115 | 115 | -- Accounts predating this schema addition may contain NULL. |
116 | | - user_registration char(14) binary, |
| 116 | + user_registration binary(14), |
117 | 117 | |
118 | 118 | -- Count of edits and edit-like actions. |
119 | 119 | -- |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | -- |
144 | 144 | CREATE TABLE /*$wgDBprefix*/user_groups ( |
145 | 145 | -- Key to user_id |
146 | | - ug_user int(5) unsigned NOT NULL default '0', |
| 146 | + ug_user int unsigned NOT NULL default '0', |
147 | 147 | |
148 | 148 | -- Group names are short symbolic string keys. |
149 | 149 | -- The set of group names is open-ended, though in practice |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | -- with particular permissions. A user will have the combined |
154 | 154 | -- permissions of any group they're explicitly in, plus |
155 | 155 | -- the implicit '*' and 'user' groups. |
156 | | - ug_group char(16) NOT NULL default '', |
| 156 | + ug_group varbinary(16) NOT NULL default '', |
157 | 157 | |
158 | 158 | PRIMARY KEY (ug_user,ug_group), |
159 | 159 | KEY (ug_group) |
— | — | @@ -162,10 +162,10 @@ |
163 | 163 | -- of the "you have new messages" box |
164 | 164 | CREATE TABLE /*$wgDBprefix*/user_newtalk ( |
165 | 165 | -- Key to user.user_id |
166 | | - user_id int(5) NOT NULL default '0', |
| 166 | + user_id int NOT NULL default '0', |
167 | 167 | -- If the user is an anonymous user their IP address is stored here |
168 | 168 | -- since the user_id of 0 is ambiguous |
169 | | - user_ip varchar(40) NOT NULL default '', |
| 169 | + user_ip varbinary(40) NOT NULL default '', |
170 | 170 | INDEX user_id (user_id), |
171 | 171 | INDEX user_ip (user_ip) |
172 | 172 | |
— | — | @@ -179,7 +179,7 @@ |
180 | 180 | CREATE TABLE /*$wgDBprefix*/page ( |
181 | 181 | -- Unique identifier number. The page_id will be preserved across |
182 | 182 | -- edits and rename operations, but not deletions and recreations. |
183 | | - page_id int(8) unsigned NOT NULL auto_increment, |
| 183 | + page_id int unsigned NOT NULL auto_increment, |
184 | 184 | |
185 | 185 | -- A page name is broken into a namespace and a title. |
186 | 186 | -- The namespace keys are UI-language-independent constants, |
— | — | @@ -195,14 +195,14 @@ |
196 | 196 | page_restrictions tinyblob NOT NULL, |
197 | 197 | |
198 | 198 | -- Number of times this page has been viewed. |
199 | | - page_counter bigint(20) unsigned NOT NULL default '0', |
| 199 | + page_counter bigint unsigned NOT NULL default '0', |
200 | 200 | |
201 | 201 | -- 1 indicates the article is a redirect. |
202 | | - page_is_redirect tinyint(1) unsigned NOT NULL default '0', |
| 202 | + page_is_redirect tinyint unsigned NOT NULL default '0', |
203 | 203 | |
204 | 204 | -- 1 indicates this is a new entry, with only one edit. |
205 | 205 | -- Not all pages with one edit are new pages. |
206 | | - page_is_new tinyint(1) unsigned NOT NULL default '0', |
| 206 | + page_is_new tinyint unsigned NOT NULL default '0', |
207 | 207 | |
208 | 208 | -- Random value between 0 and 1, used for Special:Randompage |
209 | 209 | page_random real unsigned NOT NULL, |
— | — | @@ -212,15 +212,15 @@ |
213 | 213 | -- Aside from editing this includes permission changes, |
214 | 214 | -- creation or deletion of linked pages, and alteration |
215 | 215 | -- of contained templates. |
216 | | - page_touched char(14) binary NOT NULL default '', |
| 216 | + page_touched binary(14) NOT NULL default '', |
217 | 217 | |
218 | 218 | -- Handy key to revision.rev_id of the current revision. |
219 | 219 | -- This may be 0 during page creation, but that shouldn't |
220 | 220 | -- happen outside of a transaction... hopefully. |
221 | | - page_latest int(8) unsigned NOT NULL, |
| 221 | + page_latest int unsigned NOT NULL, |
222 | 222 | |
223 | 223 | -- Uncompressed length in bytes of the page's current source text. |
224 | | - page_len int(8) unsigned NOT NULL, |
| 224 | + page_len int unsigned NOT NULL, |
225 | 225 | |
226 | 226 | PRIMARY KEY page_id (page_id), |
227 | 227 | UNIQUE INDEX name_title (page_namespace,page_title), |
— | — | @@ -237,16 +237,16 @@ |
238 | 238 | -- to the text storage backend. |
239 | 239 | -- |
240 | 240 | CREATE TABLE /*$wgDBprefix*/revision ( |
241 | | - rev_id int(8) unsigned NOT NULL auto_increment, |
| 241 | + rev_id int unsigned NOT NULL auto_increment, |
242 | 242 | |
243 | 243 | -- Key to page_id. This should _never_ be invalid. |
244 | | - rev_page int(8) unsigned NOT NULL, |
| 244 | + rev_page int unsigned NOT NULL, |
245 | 245 | |
246 | 246 | -- Key to text.old_id, where the actual bulk text is stored. |
247 | 247 | -- It's possible for multiple revisions to use the same text, |
248 | 248 | -- for instance revisions where only metadata is altered |
249 | 249 | -- or a rollback to a previous version. |
250 | | - rev_text_id int(8) unsigned NOT NULL, |
| 250 | + rev_text_id int unsigned NOT NULL, |
251 | 251 | |
252 | 252 | -- Text comment summarizing the change. |
253 | 253 | -- This text is shown in the history and other changes lists, |
— | — | @@ -255,27 +255,27 @@ |
256 | 256 | |
257 | 257 | -- Key to user.user_id of the user who made this edit. |
258 | 258 | -- Stores 0 for anonymous edits and for some mass imports. |
259 | | - rev_user int(5) unsigned NOT NULL default '0', |
| 259 | + rev_user int unsigned NOT NULL default '0', |
260 | 260 | |
261 | 261 | -- Text username or IP address of the editor. |
262 | 262 | rev_user_text varchar(255) binary NOT NULL default '', |
263 | 263 | |
264 | 264 | -- Timestamp |
265 | | - rev_timestamp char(14) binary NOT NULL default '', |
| 265 | + rev_timestamp binary(14) NOT NULL default '', |
266 | 266 | |
267 | 267 | -- Records whether the user marked the 'minor edit' checkbox. |
268 | 268 | -- Many automated edits are marked as minor. |
269 | | - rev_minor_edit tinyint(1) unsigned NOT NULL default '0', |
| 269 | + rev_minor_edit tinyint unsigned NOT NULL default '0', |
270 | 270 | |
271 | 271 | -- Not yet used; reserved for future changes to the deletion system. |
272 | | - rev_deleted tinyint(1) unsigned NOT NULL default '0', |
| 272 | + rev_deleted tinyint unsigned NOT NULL default '0', |
273 | 273 | |
274 | 274 | -- Length of this revision in bytes |
275 | | - rev_len int(8) unsigned, |
| 275 | + rev_len int unsigned, |
276 | 276 | |
277 | 277 | -- Key to revision.rev_id |
278 | 278 | -- This field is used to add support for a tree structure (The Adjacency List Model) |
279 | | - rev_parent_id int(8) unsigned default NULL, |
| 279 | + rev_parent_id int unsigned default NULL, |
280 | 280 | |
281 | 281 | PRIMARY KEY rev_page_id (rev_page, rev_id), |
282 | 282 | UNIQUE INDEX rev_id (rev_id), |
— | — | @@ -301,7 +301,7 @@ |
302 | 302 | -- refer to this number anymore, but to rev_id. |
303 | 303 | -- |
304 | 304 | -- revision.rev_text_id is a key to this column |
305 | | - old_id int(8) unsigned NOT NULL auto_increment, |
| 305 | + old_id int unsigned NOT NULL auto_increment, |
306 | 306 | |
307 | 307 | -- Depending on the contents of the old_flags field, the text |
308 | 308 | -- may be convenient plain text, or it may be funkily encoded. |
— | — | @@ -343,10 +343,10 @@ |
344 | 344 | |
345 | 345 | -- Basic revision stuff... |
346 | 346 | ar_comment tinyblob NOT NULL, |
347 | | - ar_user int(5) unsigned NOT NULL default '0', |
| 347 | + ar_user int unsigned NOT NULL default '0', |
348 | 348 | ar_user_text varchar(255) binary NOT NULL, |
349 | | - ar_timestamp char(14) binary NOT NULL default '', |
350 | | - ar_minor_edit tinyint(1) NOT NULL default '0', |
| 349 | + ar_timestamp binary(14) NOT NULL default '', |
| 350 | + ar_minor_edit tinyint NOT NULL default '0', |
351 | 351 | |
352 | 352 | -- See ar_text note. |
353 | 353 | ar_flags tinyblob NOT NULL, |
— | — | @@ -358,7 +358,7 @@ |
359 | 359 | -- |
360 | 360 | -- Old entries from 1.4 will be NULL here, and a new rev_id will |
361 | 361 | -- be created on undeletion for those revisions. |
362 | | - ar_rev_id int(8) unsigned, |
| 362 | + ar_rev_id int unsigned, |
363 | 363 | |
364 | 364 | -- For newly deleted revisions, this is the text.old_id key to the |
365 | 365 | -- actual stored text. To avoid breaking the block-compression scheme |
— | — | @@ -369,13 +369,13 @@ |
370 | 370 | -- Old entries deleted under 1.2-1.4 will have NULL here, and their |
371 | 371 | -- ar_text and ar_flags fields will be used to create a new text |
372 | 372 | -- row upon undeletion. |
373 | | - ar_text_id int(8) unsigned, |
| 373 | + ar_text_id int unsigned, |
374 | 374 | |
375 | 375 | -- rev_deleted for archives |
376 | | - ar_deleted tinyint(1) unsigned NOT NULL default '0', |
| 376 | + ar_deleted tinyint unsigned NOT NULL default '0', |
377 | 377 | |
378 | 378 | -- Length of this revision in bytes |
379 | | - ar_len int(8) unsigned, |
| 379 | + ar_len int unsigned, |
380 | 380 | |
381 | 381 | KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp) |
382 | 382 | |
— | — | @@ -387,7 +387,7 @@ |
388 | 388 | -- |
389 | 389 | CREATE TABLE /*$wgDBprefix*/pagelinks ( |
390 | 390 | -- Key to the page_id of the page containing the link. |
391 | | - pl_from int(8) unsigned NOT NULL default '0', |
| 391 | + pl_from int unsigned NOT NULL default '0', |
392 | 392 | |
393 | 393 | -- Key to page_namespace/page_title of the target page. |
394 | 394 | -- The target page may or may not exist, and due to renames |
— | — | @@ -407,7 +407,7 @@ |
408 | 408 | -- |
409 | 409 | CREATE TABLE /*$wgDBprefix*/templatelinks ( |
410 | 410 | -- Key to the page_id of the page containing the link. |
411 | | - tl_from int(8) unsigned NOT NULL default '0', |
| 411 | + tl_from int unsigned NOT NULL default '0', |
412 | 412 | |
413 | 413 | -- Key to page_namespace/page_title of the target page. |
414 | 414 | -- The target page may or may not exist, and due to renames |
— | — | @@ -428,7 +428,7 @@ |
429 | 429 | -- |
430 | 430 | CREATE TABLE /*$wgDBprefix*/imagelinks ( |
431 | 431 | -- Key to page_id of the page containing the image / media link. |
432 | | - il_from int(8) unsigned NOT NULL default '0', |
| 432 | + il_from int unsigned NOT NULL default '0', |
433 | 433 | |
434 | 434 | -- Filename of target image. |
435 | 435 | -- This is also the page_title of the file's description page; |
— | — | @@ -447,7 +447,7 @@ |
448 | 448 | -- |
449 | 449 | CREATE TABLE /*$wgDBprefix*/categorylinks ( |
450 | 450 | -- Key to page_id of the page defined as a category member. |
451 | | - cl_from int(8) unsigned NOT NULL default '0', |
| 451 | + cl_from int unsigned NOT NULL default '0', |
452 | 452 | |
453 | 453 | -- Name of the category. |
454 | 454 | -- This is also the page_title of the category's description page; |
— | — | @@ -460,11 +460,9 @@ |
461 | 461 | -- and dangerous new world in MySQL... The sortkey is updated |
462 | 462 | -- if no override exists and cl_from is renamed. |
463 | 463 | -- |
464 | | - -- For MySQL 4.1+ with charset set to utf8, the sort key *index* |
465 | | - -- needs cut to be smaller than 1024 bytes (at 3 bytes per char). |
466 | | - -- To sort properly on the shorter key, this field needs to be |
467 | | - -- the same shortness. |
468 | | - cl_sortkey varchar(86) binary NOT NULL default '', |
| 464 | + -- Truncate so that the cl_sortkey key fits in 1000 bytes |
| 465 | + -- (MyISAM 5 with server_character_set=utf8) |
| 466 | + cl_sortkey varchar(70) binary NOT NULL default '', |
469 | 467 | |
470 | 468 | -- This isn't really used at present. Provided for an optional |
471 | 469 | -- sorting method by approximate addition time. |
— | — | @@ -485,7 +483,7 @@ |
486 | 484 | -- |
487 | 485 | CREATE TABLE /*$wgDBprefix*/externallinks ( |
488 | 486 | -- page_id of the referring page |
489 | | - el_from int(8) unsigned NOT NULL default '0', |
| 487 | + el_from int unsigned NOT NULL default '0', |
490 | 488 | |
491 | 489 | -- The URL |
492 | 490 | el_to blob NOT NULL, |
— | — | @@ -513,10 +511,10 @@ |
514 | 512 | -- |
515 | 513 | CREATE TABLE /*$wgDBprefix*/langlinks ( |
516 | 514 | -- page_id of the referring page |
517 | | - ll_from int(8) unsigned NOT NULL default '0', |
| 515 | + ll_from int unsigned NOT NULL default '0', |
518 | 516 | |
519 | 517 | -- Language code of the target |
520 | | - ll_lang varchar(10) binary NOT NULL default '', |
| 518 | + ll_lang varbinary(20) NOT NULL default '', |
521 | 519 | |
522 | 520 | -- Title of the target, including namespace |
523 | 521 | ll_title varchar(255) binary NOT NULL default '', |
— | — | @@ -531,32 +529,32 @@ |
532 | 530 | -- |
533 | 531 | CREATE TABLE /*$wgDBprefix*/site_stats ( |
534 | 532 | -- The single row should contain 1 here. |
535 | | - ss_row_id int(8) unsigned NOT NULL, |
| 533 | + ss_row_id int unsigned NOT NULL, |
536 | 534 | |
537 | 535 | -- Total number of page views, if hit counters are enabled. |
538 | | - ss_total_views bigint(20) unsigned default '0', |
| 536 | + ss_total_views bigint unsigned default '0', |
539 | 537 | |
540 | 538 | -- Total number of edits performed. |
541 | | - ss_total_edits bigint(20) unsigned default '0', |
| 539 | + ss_total_edits bigint unsigned default '0', |
542 | 540 | |
543 | 541 | -- An approximate count of pages matching the following criteria: |
544 | 542 | -- * in namespace 0 |
545 | 543 | -- * not a redirect |
546 | 544 | -- * contains the text '[[' |
547 | 545 | -- See Article::isCountable() in includes/Article.php |
548 | | - ss_good_articles bigint(20) unsigned default '0', |
| 546 | + ss_good_articles bigint unsigned default '0', |
549 | 547 | |
550 | 548 | -- Total pages, theoretically equal to SELECT COUNT(*) FROM page; except faster |
551 | | - ss_total_pages bigint(20) default '-1', |
| 549 | + ss_total_pages bigint default '-1', |
552 | 550 | |
553 | 551 | -- Number of users, theoretically equal to SELECT COUNT(*) FROM user; |
554 | | - ss_users bigint(20) default '-1', |
| 552 | + ss_users bigint default '-1', |
555 | 553 | |
556 | 554 | -- Deprecated, no longer updated as of 1.5 |
557 | | - ss_admins int(10) default '-1', |
| 555 | + ss_admins int default '-1', |
558 | 556 | |
559 | 557 | -- Number of images, equivalent to SELECT COUNT(*) FROM image |
560 | | - ss_images int(10) default '0', |
| 558 | + ss_images int default '0', |
561 | 559 | |
562 | 560 | UNIQUE KEY ss_row_id (ss_row_id) |
563 | 561 | |
— | — | @@ -580,23 +578,23 @@ |
581 | 579 | -- |
582 | 580 | CREATE TABLE /*$wgDBprefix*/ipblocks ( |
583 | 581 | -- Primary key, introduced for privacy. |
584 | | - ipb_id int(8) NOT NULL auto_increment, |
| 582 | + ipb_id int NOT NULL auto_increment, |
585 | 583 | |
586 | 584 | -- Blocked IP address in dotted-quad form or user name. |
587 | 585 | ipb_address tinyblob NOT NULL, |
588 | 586 | |
589 | 587 | -- Blocked user ID or 0 for IP blocks. |
590 | | - ipb_user int(8) unsigned NOT NULL default '0', |
| 588 | + ipb_user int unsigned NOT NULL default '0', |
591 | 589 | |
592 | 590 | -- User ID who made the block. |
593 | | - ipb_by int(8) unsigned NOT NULL default '0', |
| 591 | + ipb_by int unsigned NOT NULL default '0', |
594 | 592 | |
595 | 593 | -- Text comment made by blocker. |
596 | 594 | ipb_reason tinyblob NOT NULL, |
597 | 595 | |
598 | 596 | -- Creation (or refresh) date in standard YMDHMS form. |
599 | 597 | -- IP blocks expire automatically. |
600 | | - ipb_timestamp char(14) binary NOT NULL default '', |
| 598 | + ipb_timestamp binary(14) NOT NULL default '', |
601 | 599 | |
602 | 600 | -- Indicates that the IP address was banned because a banned |
603 | 601 | -- user accessed a page through it. If this is 1, ipb_address |
— | — | @@ -613,7 +611,8 @@ |
614 | 612 | ipb_enable_autoblock bool NOT NULL default '1', |
615 | 613 | |
616 | 614 | -- Time at which the block will expire. |
617 | | - ipb_expiry char(14) binary NOT NULL default '', |
| 615 | + -- May be "infinity" |
| 616 | + ipb_expiry varbinary(14) NOT NULL default '', |
618 | 617 | |
619 | 618 | -- Start and end of an address range, in hexadecimal |
620 | 619 | -- Size chosen to allow IPv6 |
— | — | @@ -650,17 +649,17 @@ |
651 | 650 | img_name varchar(255) binary NOT NULL default '', |
652 | 651 | |
653 | 652 | -- File size in bytes. |
654 | | - img_size int(8) unsigned NOT NULL default '0', |
| 653 | + img_size int unsigned NOT NULL default '0', |
655 | 654 | |
656 | 655 | -- For images, size in pixels. |
657 | | - img_width int(5) NOT NULL default '0', |
658 | | - img_height int(5) NOT NULL default '0', |
| 656 | + img_width int NOT NULL default '0', |
| 657 | + img_height int NOT NULL default '0', |
659 | 658 | |
660 | 659 | -- Extracted EXIF metadata stored as a serialized PHP array. |
661 | 660 | img_metadata mediumblob NOT NULL, |
662 | 661 | |
663 | 662 | -- For images, bits per pixel if known. |
664 | | - img_bits int(3) NOT NULL default '0', |
| 663 | + img_bits int NOT NULL default '0', |
665 | 664 | |
666 | 665 | -- Media type as defined by the MEDIATYPE_xxx constants |
667 | 666 | img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
— | — | @@ -673,18 +672,18 @@ |
674 | 673 | -- the minor parts are not required to adher to any standard |
675 | 674 | -- but should be consistent throughout the database |
676 | 675 | -- see http://www.iana.org/assignments/media-types/ |
677 | | - img_minor_mime varchar(32) NOT NULL default "unknown", |
| 676 | + img_minor_mime varbinary(32) NOT NULL default "unknown", |
678 | 677 | |
679 | 678 | -- Description field as entered by the uploader. |
680 | 679 | -- This is displayed in image upload history and logs. |
681 | 680 | img_description tinyblob NOT NULL, |
682 | 681 | |
683 | 682 | -- user_id and user_name of uploader. |
684 | | - img_user int(5) unsigned NOT NULL default '0', |
| 683 | + img_user int unsigned NOT NULL default '0', |
685 | 684 | img_user_text varchar(255) binary NOT NULL, |
686 | 685 | |
687 | 686 | -- Time of the upload. |
688 | | - img_timestamp char(14) binary NOT NULL default '', |
| 687 | + img_timestamp varbinary(14) NOT NULL default '', |
689 | 688 | |
690 | 689 | PRIMARY KEY img_name (img_name), |
691 | 690 | |
— | — | @@ -710,23 +709,24 @@ |
711 | 710 | oi_archive_name varchar(255) binary NOT NULL default '', |
712 | 711 | |
713 | 712 | -- Other fields as in image... |
714 | | - oi_size int(8) unsigned NOT NULL default 0, |
715 | | - oi_width int(5) NOT NULL default 0, |
716 | | - oi_height int(5) NOT NULL default 0, |
717 | | - oi_bits int(3) NOT NULL default 0, |
| 713 | + oi_size int unsigned NOT NULL default 0, |
| 714 | + oi_width int NOT NULL default 0, |
| 715 | + oi_height int NOT NULL default 0, |
| 716 | + oi_bits int NOT NULL default 0, |
718 | 717 | oi_description tinyblob NOT NULL, |
719 | | - oi_user int(5) unsigned NOT NULL default '0', |
| 718 | + oi_user int unsigned NOT NULL default '0', |
720 | 719 | oi_user_text varchar(255) binary NOT NULL, |
721 | | - oi_timestamp char(14) binary NOT NULL default '', |
| 720 | + oi_timestamp binary(14) NOT NULL default '', |
722 | 721 | |
723 | 722 | oi_metadata mediumblob NOT NULL, |
724 | 723 | oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
725 | 724 | oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", |
726 | | - oi_minor_mime varchar(32) NOT NULL default "unknown", |
727 | | - oi_deleted tinyint(1) unsigned NOT NULL default '0', |
| 725 | + oi_minor_mime varbinary(32) NOT NULL default "unknown", |
| 726 | + oi_deleted tinyint unsigned NOT NULL default '0', |
728 | 727 | |
729 | 728 | INDEX oi_name_timestamp (oi_name,oi_timestamp), |
730 | | - INDEX oi_name_archive_name (oi_name,oi_archive_name) |
| 729 | + -- oi_archive_name truncated to 14 to avoid key length overflow |
| 730 | + INDEX oi_name_archive_name (oi_name,oi_archive_name(14)) |
731 | 731 | |
732 | 732 | ) /*$wgDBTableOptions*/; |
733 | 733 | |
— | — | @@ -746,36 +746,36 @@ |
747 | 747 | -- Which storage bin (directory tree or object store) the file data |
748 | 748 | -- is stored in. Should be 'deleted' for files that have been deleted; |
749 | 749 | -- any other bin is not yet in use. |
750 | | - fa_storage_group varchar(16), |
| 750 | + fa_storage_group varbinary(16), |
751 | 751 | |
752 | 752 | -- SHA-1 of the file contents plus extension, used as a key for storage. |
753 | 753 | -- eg 8f8a562add37052a1848ff7771a2c515db94baa9.jpg |
754 | 754 | -- |
755 | 755 | -- If NULL, the file was missing at deletion time or has been purged |
756 | 756 | -- from the archival storage. |
757 | | - fa_storage_key varchar(64) binary default '', |
| 757 | + fa_storage_key varbinary(64) default '', |
758 | 758 | |
759 | 759 | -- Deletion information, if this file is deleted. |
760 | 760 | fa_deleted_user int, |
761 | | - fa_deleted_timestamp char(14) binary default '', |
| 761 | + fa_deleted_timestamp binary(14) default '', |
762 | 762 | fa_deleted_reason text, |
763 | 763 | |
764 | 764 | -- Duped fields from image |
765 | | - fa_size int(8) unsigned default '0', |
766 | | - fa_width int(5) default '0', |
767 | | - fa_height int(5) default '0', |
| 765 | + fa_size int unsigned default '0', |
| 766 | + fa_width int default '0', |
| 767 | + fa_height int default '0', |
768 | 768 | fa_metadata mediumblob, |
769 | | - fa_bits int(3) default '0', |
| 769 | + fa_bits int default '0', |
770 | 770 | fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
771 | 771 | fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", |
772 | 772 | fa_minor_mime varchar(32) default "unknown", |
773 | 773 | fa_description tinyblob, |
774 | | - fa_user int(5) unsigned default '0', |
| 774 | + fa_user int unsigned default '0', |
775 | 775 | fa_user_text varchar(255) binary, |
776 | | - fa_timestamp char(14) binary default '', |
| 776 | + fa_timestamp binary(14) default '', |
777 | 777 | |
778 | 778 | -- Visibility of deleted revisions, bitfield |
779 | | - fa_deleted tinyint(1) unsigned NOT NULL default '0', |
| 779 | + fa_deleted tinyint unsigned NOT NULL default '0', |
780 | 780 | |
781 | 781 | PRIMARY KEY (fa_id), |
782 | 782 | INDEX (fa_name, fa_timestamp), -- pick out by image name |
— | — | @@ -791,12 +791,12 @@ |
792 | 792 | -- the last few days, see Article::editUpdates() |
793 | 793 | -- |
794 | 794 | CREATE TABLE /*$wgDBprefix*/recentchanges ( |
795 | | - rc_id int(8) NOT NULL auto_increment, |
796 | | - rc_timestamp varchar(14) binary NOT NULL default '', |
797 | | - rc_cur_time varchar(14) binary NOT NULL default '', |
| 795 | + rc_id int NOT NULL auto_increment, |
| 796 | + rc_timestamp varbinary(14) NOT NULL default '', |
| 797 | + rc_cur_time varbinary(14) NOT NULL default '', |
798 | 798 | |
799 | 799 | -- As in revision |
800 | | - rc_user int(10) unsigned NOT NULL default '0', |
| 800 | + rc_user int unsigned NOT NULL default '0', |
801 | 801 | rc_user_text varchar(255) binary NOT NULL, |
802 | 802 | |
803 | 803 | -- When pages are renamed, their RC entries do _not_ change. |
— | — | @@ -805,51 +805,51 @@ |
806 | 806 | |
807 | 807 | -- as in revision... |
808 | 808 | rc_comment varchar(255) binary NOT NULL default '', |
809 | | - rc_minor tinyint(3) unsigned NOT NULL default '0', |
| 809 | + rc_minor tinyint unsigned NOT NULL default '0', |
810 | 810 | |
811 | 811 | -- Edits by user accounts with the 'bot' rights key are |
812 | 812 | -- marked with a 1 here, and will be hidden from the |
813 | 813 | -- default view. |
814 | | - rc_bot tinyint(3) unsigned NOT NULL default '0', |
| 814 | + rc_bot tinyint unsigned NOT NULL default '0', |
815 | 815 | |
816 | | - rc_new tinyint(3) unsigned NOT NULL default '0', |
| 816 | + rc_new tinyint unsigned NOT NULL default '0', |
817 | 817 | |
818 | 818 | -- Key to page_id (was cur_id prior to 1.5). |
819 | 819 | -- This will keep links working after moves while |
820 | 820 | -- retaining the at-the-time name in the changes list. |
821 | | - rc_cur_id int(10) unsigned NOT NULL default '0', |
| 821 | + rc_cur_id int unsigned NOT NULL default '0', |
822 | 822 | |
823 | 823 | -- rev_id of the given revision |
824 | | - rc_this_oldid int(10) unsigned NOT NULL default '0', |
| 824 | + rc_this_oldid int unsigned NOT NULL default '0', |
825 | 825 | |
826 | 826 | -- rev_id of the prior revision, for generating diff links. |
827 | | - rc_last_oldid int(10) unsigned NOT NULL default '0', |
| 827 | + rc_last_oldid int unsigned NOT NULL default '0', |
828 | 828 | |
829 | 829 | -- These may no longer be used, with the new move log. |
830 | | - rc_type tinyint(3) unsigned NOT NULL default '0', |
831 | | - rc_moved_to_ns tinyint(3) unsigned NOT NULL default '0', |
| 830 | + rc_type tinyint unsigned NOT NULL default '0', |
| 831 | + rc_moved_to_ns tinyint unsigned NOT NULL default '0', |
832 | 832 | rc_moved_to_title varchar(255) binary NOT NULL default '', |
833 | 833 | |
834 | 834 | -- If the Recent Changes Patrol option is enabled, |
835 | 835 | -- users may mark edits as having been reviewed to |
836 | 836 | -- remove a warning flag on the RC list. |
837 | 837 | -- A value of 1 indicates the page has been reviewed. |
838 | | - rc_patrolled tinyint(3) unsigned NOT NULL default '0', |
| 838 | + rc_patrolled tinyint unsigned NOT NULL default '0', |
839 | 839 | |
840 | 840 | -- Recorded IP address the edit was made from, if the |
841 | 841 | -- $wgPutIPinRC option is enabled. |
842 | | - rc_ip char(15) NOT NULL default '', |
| 842 | + rc_ip varbinary(40) NOT NULL default '', |
843 | 843 | |
844 | 844 | -- Text length in characters before |
845 | 845 | -- and after the edit |
846 | | - rc_old_len int(10), |
847 | | - rc_new_len int(10), |
| 846 | + rc_old_len int, |
| 847 | + rc_new_len int, |
848 | 848 | |
849 | 849 | -- Visibility of deleted revisions, bitfield |
850 | | - rc_deleted tinyint(1) unsigned NOT NULL default '0', |
| 850 | + rc_deleted tinyint unsigned NOT NULL default '0', |
851 | 851 | |
852 | 852 | -- Value corresonding to log_id, specific log entries |
853 | | - rc_logid int(10) unsigned NOT NULL default '0', |
| 853 | + rc_logid int unsigned NOT NULL default '0', |
854 | 854 | -- Store log type info here, or null |
855 | 855 | rc_log_type varchar(255) binary NULL default NULL, |
856 | 856 | -- Store log action or null |
— | — | @@ -870,7 +870,7 @@ |
871 | 871 | |
872 | 872 | CREATE TABLE /*$wgDBprefix*/watchlist ( |
873 | 873 | -- Key to user.user_id |
874 | | - wl_user int(5) unsigned NOT NULL, |
| 874 | + wl_user int unsigned NOT NULL, |
875 | 875 | |
876 | 876 | -- Key to page_namespace/page_title |
877 | 877 | -- Note that users may watch pages which do not exist yet, |
— | — | @@ -880,7 +880,7 @@ |
881 | 881 | |
882 | 882 | -- Timestamp when user was last sent a notification e-mail; |
883 | 883 | -- cleared when the user visits the page. |
884 | | - wl_notificationtimestamp varchar(14) binary, |
| 884 | + wl_notificationtimestamp varbinary(14), |
885 | 885 | |
886 | 886 | UNIQUE KEY (wl_user, wl_namespace, wl_title), |
887 | 887 | KEY namespace_title (wl_namespace, wl_title) |
— | — | @@ -894,14 +894,14 @@ |
895 | 895 | -- |
896 | 896 | CREATE TABLE /*$wgDBprefix*/math ( |
897 | 897 | -- Binary MD5 hash of the latex fragment, used as an identifier key. |
898 | | - math_inputhash varchar(16) NOT NULL, |
| 898 | + math_inputhash varbinary(16) NOT NULL, |
899 | 899 | |
900 | 900 | -- Not sure what this is, exactly... |
901 | | - math_outputhash varchar(16) NOT NULL, |
| 901 | + math_outputhash varbinary(16) NOT NULL, |
902 | 902 | |
903 | 903 | -- texvc reports how well it thinks the HTML conversion worked; |
904 | 904 | -- if it's a low level the PNG rendering may be preferred. |
905 | | - math_html_conservativeness tinyint(1) NOT NULL, |
| 905 | + math_html_conservativeness tinyint NOT NULL, |
906 | 906 | |
907 | 907 | -- HTML output from texvc, if any |
908 | 908 | math_html text, |
— | — | @@ -923,7 +923,7 @@ |
924 | 924 | -- |
925 | 925 | CREATE TABLE /*$wgDBprefix*/searchindex ( |
926 | 926 | -- Key to page_id |
927 | | - si_page int(8) unsigned NOT NULL, |
| 927 | + si_page int unsigned NOT NULL, |
928 | 928 | |
929 | 929 | -- Munged version of title |
930 | 930 | si_title varchar(255) NOT NULL default '', |
— | — | @@ -942,19 +942,19 @@ |
943 | 943 | -- |
944 | 944 | CREATE TABLE /*$wgDBprefix*/interwiki ( |
945 | 945 | -- The interwiki prefix, (e.g. "Meatball", or the language prefix "de") |
946 | | - iw_prefix char(32) NOT NULL, |
| 946 | + iw_prefix varchar(32) NOT NULL, |
947 | 947 | |
948 | 948 | -- The URL of the wiki, with "$1" as a placeholder for an article name. |
949 | 949 | -- Any spaces in the name will be transformed to underscores before |
950 | 950 | -- insertion. |
951 | | - iw_url varchar(127) NOT NULL, |
| 951 | + iw_url blob NOT NULL, |
952 | 952 | |
953 | 953 | -- A boolean value indicating whether the wiki is in this project |
954 | 954 | -- (used, for example, to detect redirect loops) |
955 | 955 | iw_local bool NOT NULL, |
956 | 956 | |
957 | 957 | -- Boolean value indicating whether interwiki transclusions are allowed. |
958 | | - iw_trans tinyint(1) NOT NULL default 0, |
| 958 | + iw_trans tinyint NOT NULL default 0, |
959 | 959 | |
960 | 960 | UNIQUE KEY iw_prefix (iw_prefix) |
961 | 961 | |
— | — | @@ -965,10 +965,10 @@ |
966 | 966 | -- |
967 | 967 | CREATE TABLE /*$wgDBprefix*/querycache ( |
968 | 968 | -- A key name, generally the base name of of the special page. |
969 | | - qc_type varchar(32) binary NOT NULL, |
| 969 | + qc_type varbinary(32) NOT NULL, |
970 | 970 | |
971 | 971 | -- Some sort of stored value. Sizes, counts... |
972 | | - qc_value int(5) unsigned NOT NULL default '0', |
| 972 | + qc_value int unsigned NOT NULL default '0', |
973 | 973 | |
974 | 974 | -- Target namespace+title |
975 | 975 | qc_namespace int NOT NULL default '0', |
— | — | @@ -982,7 +982,7 @@ |
983 | 983 | -- For a few generic cache operations if not using Memcached |
984 | 984 | -- |
985 | 985 | CREATE TABLE /*$wgDBprefix*/objectcache ( |
986 | | - keyname varchar(255) binary NOT NULL default '', |
| 986 | + keyname varbinary(255) NOT NULL default '', |
987 | 987 | value mediumblob, |
988 | 988 | exptime datetime, |
989 | 989 | UNIQUE KEY (keyname), |
— | — | @@ -1004,11 +1004,11 @@ |
1005 | 1005 | -- Symbolic keys for the general log type and the action type |
1006 | 1006 | -- within the log. The output format will be controlled by the |
1007 | 1007 | -- action field, but only the type controls categorization. |
1008 | | - log_type char(10) NOT NULL default '', |
1009 | | - log_action char(10) NOT NULL default '', |
| 1008 | + log_type varbinary(20) NOT NULL default '', |
| 1009 | + log_action varbinary(20) NOT NULL default '', |
1010 | 1010 | |
1011 | 1011 | -- Timestamp. Duh. |
1012 | | - log_timestamp char(14) NOT NULL default '19700101000000', |
| 1012 | + log_timestamp binary(14) NOT NULL default '19700101000000', |
1013 | 1013 | |
1014 | 1014 | -- The user who performed this action; key to user_id |
1015 | 1015 | log_user int unsigned NOT NULL default 0, |
— | — | @@ -1028,7 +1028,7 @@ |
1029 | 1029 | log_id int unsigned NOT NULL auto_increment, |
1030 | 1030 | |
1031 | 1031 | -- rev_deleted for logs |
1032 | | - log_deleted tinyint(1) unsigned NOT NULL default '0', |
| 1032 | + log_deleted tinyint unsigned NOT NULL default '0', |
1033 | 1033 | |
1034 | 1034 | PRIMARY KEY log_id (log_id), |
1035 | 1035 | KEY type_time (log_type, log_timestamp), |
— | — | @@ -1042,7 +1042,7 @@ |
1043 | 1043 | tb_id int auto_increment, |
1044 | 1044 | tb_page int REFERENCES page(page_id) ON DELETE CASCADE, |
1045 | 1045 | tb_title varchar(255) NOT NULL, |
1046 | | - tb_url varchar(255) NOT NULL, |
| 1046 | + tb_url blob NOT NULL, |
1047 | 1047 | tb_ex text, |
1048 | 1048 | tb_name varchar(255), |
1049 | 1049 | |
— | — | @@ -1053,10 +1053,11 @@ |
1054 | 1054 | |
1055 | 1055 | -- Jobs performed by parallel apache threads or a command-line daemon |
1056 | 1056 | CREATE TABLE /*$wgDBprefix*/job ( |
1057 | | - job_id int(9) unsigned NOT NULL auto_increment, |
| 1057 | + job_id int unsigned NOT NULL auto_increment, |
1058 | 1058 | |
1059 | | - -- Command name, currently only refreshLinks is defined |
1060 | | - job_cmd varchar(255) NOT NULL default '', |
| 1059 | + -- Command name |
| 1060 | + -- Limited to 60 to prevent key length overflow |
| 1061 | + job_cmd varbinary(60) NOT NULL default '', |
1061 | 1062 | |
1062 | 1063 | -- Namespace and title to act on |
1063 | 1064 | -- Should be 0 and '' if the command does not operate on a title |
— | — | @@ -1080,7 +1081,7 @@ |
1081 | 1082 | qci_type varchar(32) NOT NULL default '', |
1082 | 1083 | |
1083 | 1084 | -- Timestamp of last update |
1084 | | - qci_timestamp char(14) NOT NULL default '19700101000000', |
| 1085 | + qci_timestamp binary(14) NOT NULL default '19700101000000', |
1085 | 1086 | |
1086 | 1087 | UNIQUE KEY ( qci_type ) |
1087 | 1088 | |
— | — | @@ -1089,7 +1090,7 @@ |
1090 | 1091 | -- For each redirect, this table contains exactly one row defining its target |
1091 | 1092 | CREATE TABLE /*$wgDBprefix*/redirect ( |
1092 | 1093 | -- Key to the page_id of the redirect page |
1093 | | - rd_from int(8) unsigned NOT NULL default '0', |
| 1094 | + rd_from int unsigned NOT NULL default '0', |
1094 | 1095 | |
1095 | 1096 | -- Key to page_namespace/page_title of the target page. |
1096 | 1097 | -- The target page may or may not exist, and due to renames |
— | — | @@ -1105,10 +1106,10 @@ |
1106 | 1107 | -- Used for caching expensive grouped queries that need two links (for example double-redirects) |
1107 | 1108 | CREATE TABLE /*$wgDBprefix*/querycachetwo ( |
1108 | 1109 | -- A key name, generally the base name of of the special page. |
1109 | | - qcc_type varchar(32) NOT NULL, |
| 1110 | + qcc_type varbinary(32) NOT NULL, |
1110 | 1111 | |
1111 | 1112 | -- Some sort of stored value. Sizes, counts... |
1112 | | - qcc_value int(5) unsigned NOT NULL default '0', |
| 1113 | + qcc_value int unsigned NOT NULL default '0', |
1113 | 1114 | |
1114 | 1115 | -- Target namespace+title |
1115 | 1116 | qcc_namespace int NOT NULL default '0', |
— | — | @@ -1127,17 +1128,17 @@ |
1128 | 1129 | -- Used for storing page restrictions (i.e. protection levels) |
1129 | 1130 | CREATE TABLE /*$wgDBprefix*/page_restrictions ( |
1130 | 1131 | -- Page to apply restrictions to (Foreign Key to page). |
1131 | | - pr_page int(8) NOT NULL, |
| 1132 | + pr_page int NOT NULL, |
1132 | 1133 | -- The protection type (edit, move, etc) |
1133 | | - pr_type varchar(255) NOT NULL, |
| 1134 | + pr_type varbinary(60) NOT NULL, |
1134 | 1135 | -- The protection level (Sysop, autoconfirmed, etc) |
1135 | | - pr_level varchar(255) NOT NULL, |
| 1136 | + pr_level varbinary(60) NOT NULL, |
1136 | 1137 | -- Whether or not to cascade the protection down to pages transcluded. |
1137 | | - pr_cascade tinyint(4) NOT NULL, |
| 1138 | + pr_cascade tinyint NOT NULL, |
1138 | 1139 | -- Field for future support of per-user restriction. |
1139 | | - pr_user int(8) NULL, |
| 1140 | + pr_user int NULL, |
1140 | 1141 | -- Field for time-limited protection. |
1141 | | - pr_expiry char(14) binary NULL, |
| 1142 | + pr_expiry varbinary(14) NULL, |
1142 | 1143 | -- Field for an ID for this restrictions row (sort-key for Special:ProtectedPages) |
1143 | 1144 | pr_id int unsigned NOT NULL auto_increment, |
1144 | 1145 | |