Index: trunk/phase3/maintenance/mysql5/tables.sql |
— | — | @@ -36,7 +36,7 @@ |
37 | 37 | -- in early 2002 after a lot of trouble with the fields |
38 | 38 | -- auto-updating. |
39 | 39 | -- |
| 40 | +-- The Postgres backend uses DATETIME fields for timestamps, |
40 | 41 | -- and we will migrate the MySQL definitions at some point as |
41 | 42 | -- well. |
42 | 43 | -- |
— | — | @@ -114,18 +114,18 @@ |
115 | 115 | -- Initially NULL; when a user's e-mail address has been |
116 | 116 | -- validated by returning with a mailed token, this is |
117 | 117 | -- set to the current timestamp. |
118 | | - user_email_authenticated CHAR(14) BINARY, |
| 118 | + user_email_authenticated char(14) binary, |
119 | 119 | |
120 | 120 | -- Randomly generated token created when the e-mail address |
121 | 121 | -- is set and a confirmation test mail sent. |
122 | | - user_email_token CHAR(32) BINARY, |
| 122 | + user_email_token char(32) binary, |
123 | 123 | |
124 | 124 | -- Expiration date for the user_email_token |
125 | | - user_email_token_expires CHAR(14) BINARY, |
| 125 | + user_email_token_expires char(14) binary, |
126 | 126 | |
127 | 127 | -- Timestamp of account registration. |
128 | 128 | -- Accounts predating this schema addition may contain NULL. |
129 | | - user_registration CHAR(14) BINARY, |
| 129 | + user_registration char(14) binary, |
130 | 130 | |
131 | 131 | PRIMARY KEY user_id (user_id), |
132 | 132 | UNIQUE INDEX user_name (user_name), |
— | — | @@ -382,7 +382,7 @@ |
383 | 383 | pl_namespace int NOT NULL default '0', |
384 | 384 | pl_title varchar(255) binary NOT NULL default '', |
385 | 385 | |
386 | | - UNIQUE KEY pl_from(pl_from,pl_namespace,pl_title), |
| 386 | + UNIQUE KEY pl_from (pl_from,pl_namespace,pl_title), |
387 | 387 | KEY (pl_namespace,pl_title) |
388 | 388 | |
389 | 389 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
— | — | @@ -402,7 +402,7 @@ |
403 | 403 | tl_namespace int NOT NULL default '0', |
404 | 404 | tl_title varchar(255) binary NOT NULL default '', |
405 | 405 | |
406 | | - UNIQUE KEY tl_from(tl_from,tl_namespace,tl_title), |
| 406 | + UNIQUE KEY tl_from (tl_from,tl_namespace,tl_title), |
407 | 407 | KEY (tl_namespace,tl_title) |
408 | 408 | |
409 | 409 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
— | — | @@ -422,7 +422,7 @@ |
423 | 423 | -- all such pages are in namespace 6 (NS_IMAGE). |
424 | 424 | il_to varchar(255) binary NOT NULL default '', |
425 | 425 | |
426 | | - UNIQUE KEY il_from(il_from,il_to), |
| 426 | + UNIQUE KEY il_from (il_from,il_to), |
427 | 427 | KEY (il_to) |
428 | 428 | |
429 | 429 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
— | — | @@ -456,13 +456,13 @@ |
457 | 457 | -- sorting method by approximate addition time. |
458 | 458 | cl_timestamp timestamp NOT NULL, |
459 | 459 | |
460 | | - UNIQUE KEY cl_from(cl_from,cl_to), |
| 460 | + UNIQUE KEY cl_from (cl_from,cl_to), |
461 | 461 | |
462 | 462 | -- We always sort within a given category... |
463 | | - KEY cl_sortkey(cl_to,cl_sortkey), |
| 463 | + KEY cl_sortkey (cl_to,cl_sortkey), |
464 | 464 | |
465 | 465 | -- Not really used? |
466 | | - KEY cl_timestamp(cl_to,cl_timestamp) |
| 466 | + KEY cl_timestamp (cl_to,cl_timestamp) |
467 | 467 | |
468 | 468 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
469 | 469 | |
— | — | @@ -556,7 +556,7 @@ |
557 | 557 | -- that have been visited.) |
558 | 558 | -- |
559 | 559 | CREATE TABLE /*$wgDBprefix*/hitcounter ( |
560 | | - hc_id INTEGER UNSIGNED NOT NULL |
| 560 | + hc_id int unsigned NOT NULL |
561 | 561 | ) ENGINE=HEAP MAX_ROWS=25000; |
562 | 562 | |
563 | 563 | |
— | — | @@ -633,14 +633,14 @@ |
634 | 634 | img_size int(8) unsigned NOT NULL default '0', |
635 | 635 | |
636 | 636 | -- For images, size in pixels. |
637 | | - img_width int(5) NOT NULL default '0', |
638 | | - img_height int(5) NOT NULL default '0', |
| 637 | + img_width int(5) NOT NULL default '0', |
| 638 | + img_height int(5) NOT NULL default '0', |
639 | 639 | |
640 | 640 | -- Extracted EXIF metadata stored as a serialized PHP array. |
641 | 641 | img_metadata mediumblob NOT NULL, |
642 | 642 | |
643 | 643 | -- For images, bits per pixel if known. |
644 | | - img_bits int(3) NOT NULL default '0', |
| 644 | + img_bits int(3) NOT NULL default '0', |
645 | 645 | |
646 | 646 | -- Media type as defined by the MEDIATYPE_xxx constants |
647 | 647 | img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
— | — | @@ -709,7 +709,7 @@ |
710 | 710 | -- |
711 | 711 | CREATE TABLE /*$wgDBprefix*/filearchive ( |
712 | 712 | -- Unique row id |
713 | | - fa_id int not null auto_increment, |
| 713 | + fa_id int NOT NULL auto_increment, |
714 | 714 | |
715 | 715 | -- Original base filename; key to image.img_name, page.page_title, etc |
716 | 716 | fa_name varchar(255) binary NOT NULL default '', |
— | — | @@ -736,10 +736,10 @@ |
737 | 737 | |
738 | 738 | -- Duped fields from image |
739 | 739 | fa_size int(8) unsigned default '0', |
740 | | - fa_width int(5) default '0', |
741 | | - fa_height int(5) default '0', |
| 740 | + fa_width int(5) default '0', |
| 741 | + fa_height int(5) default '0', |
742 | 742 | fa_metadata mediumblob, |
743 | | - fa_bits int(3) default '0', |
| 743 | + fa_bits int(3) default '0', |
744 | 744 | fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
745 | 745 | fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", |
746 | 746 | fa_minor_mime varchar(32) default "unknown", |
— | — | @@ -815,7 +815,7 @@ |
816 | 816 | INDEX rc_timestamp (rc_timestamp), |
817 | 817 | INDEX rc_namespace_title (rc_namespace, rc_title), |
818 | 818 | INDEX rc_cur_id (rc_cur_id), |
819 | | - INDEX new_name_timestamp(rc_new,rc_namespace,rc_timestamp), |
| 819 | + INDEX new_name_timestamp (rc_new,rc_namespace,rc_timestamp), |
820 | 820 | INDEX rc_ip (rc_ip), |
821 | 821 | INDEX rc_ns_usertext ( rc_namespace, rc_user_text ) |
822 | 822 | |
— | — | @@ -904,10 +904,10 @@ |
905 | 905 | |
906 | 906 | -- A boolean value indicating whether the wiki is in this project |
907 | 907 | -- (used, for example, to detect redirect loops) |
908 | | - iw_local BOOL NOT NULL, |
| 908 | + iw_local bool NOT NULL, |
909 | 909 | |
910 | 910 | -- Boolean value indicating whether interwiki transclusions are allowed. |
911 | | - iw_trans TINYINT(1) NOT NULL DEFAULT 0, |
| 911 | + iw_trans tinyint(1) NOT NULL default 0, |
912 | 912 | |
913 | 913 | UNIQUE KEY iw_prefix (iw_prefix) |
914 | 914 | |
— | — | @@ -935,11 +935,11 @@ |
936 | 936 | -- For a few generic cache operations if not using Memcached |
937 | 937 | -- |
938 | 938 | CREATE TABLE /*$wgDBprefix*/objectcache ( |
939 | | - keyname char(255) binary not null default '', |
| 939 | + keyname char(255) binary NOT NULL default '', |
940 | 940 | value mediumblob, |
941 | 941 | exptime datetime, |
942 | | - unique key (keyname), |
943 | | - key (exptime) |
| 942 | + UNIQUE KEY (keyname), |
| 943 | + KEY (exptime) |
944 | 944 | |
945 | 945 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
946 | 946 | |
— | — | @@ -947,10 +947,10 @@ |
948 | 948 | -- Cache of interwiki transclusion |
949 | 949 | -- |
950 | 950 | CREATE TABLE /*$wgDBprefix*/transcache ( |
951 | | - tc_url VARCHAR(255) NOT NULL, |
952 | | - tc_contents TEXT, |
953 | | - tc_time INT NOT NULL, |
954 | | - UNIQUE INDEX tc_url_idx(tc_url) |
| 951 | + tc_url varchar(255) NOT NULL, |
| 952 | + tc_contents text, |
| 953 | + tc_time int NOT NULL, |
| 954 | + UNIQUE INDEX tc_url_idx (tc_url) |
955 | 955 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
956 | 956 | |
957 | 957 | CREATE TABLE /*$wgDBprefix*/logging ( |
— | — | @@ -984,14 +984,15 @@ |
985 | 985 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
986 | 986 | |
987 | 987 | CREATE TABLE /*$wgDBprefix*/trackbacks ( |
988 | | - tb_id integer AUTO_INCREMENT PRIMARY KEY, |
989 | | - tb_page integer REFERENCES page(page_id) ON DELETE CASCADE, |
990 | | - tb_title varchar(255) NOT NULL, |
991 | | - tb_url varchar(255) NOT NULL, |
992 | | - tb_ex text, |
993 | | - tb_name varchar(255), |
| 988 | + tb_id int auto_increment, |
| 989 | + tb_page int REFERENCES page(page_id) ON DELETE CASCADE, |
| 990 | + tb_title varchar(255) NOT NULL, |
| 991 | + tb_url varchar(255) NOT NULL, |
| 992 | + tb_ex text, |
| 993 | + tb_name varchar(255), |
994 | 994 | |
995 | | - INDEX (tb_page) |
| 995 | + PRIMARY KEY (tb_id), |
| 996 | + INDEX (tb_page) |
996 | 997 | ) ENGINE=InnoDB, DEFAULT CHARSET=utf8; |
997 | 998 | |
998 | 999 | -- Jobs performed by parallel apache threads or a command-line daemon |
— | — | @@ -1017,14 +1018,14 @@ |
1018 | 1019 | -- Details of updates to cached special pages |
1019 | 1020 | CREATE TABLE /*$wgDBprefix*/querycache_info ( |
1020 | 1021 | |
1021 | | - -- Special page name |
1022 | | - -- Corresponds to a qc_type value |
1023 | | - qci_type varchar(32) NOT NULL default '', |
| 1022 | + -- Special page name |
| 1023 | + -- Corresponds to a qc_type value |
| 1024 | + qci_type varchar(32) NOT NULL default '', |
1024 | 1025 | |
1025 | | - -- Timestamp of last update |
1026 | | - qci_timestamp char(14) NOT NULL default '19700101000000', |
| 1026 | + -- Timestamp of last update |
| 1027 | + qci_timestamp char(14) NOT NULL default '19700101000000', |
1027 | 1028 | |
1028 | | - UNIQUE KEY ( qci_type ) |
| 1029 | + UNIQUE KEY ( qci_type ) |
1029 | 1030 | |
1030 | 1031 | ) ENGINE=InnoDB; |
1031 | 1032 | |