r87731 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87730‎ | r87731 | r87732 >
Date:16:41, 9 May 2011
Author:maxsem
Status:resolved (Comments)
Tags:
Comment:
Automatic testing of SQLite updates from all (previoisly) supported versions
Modified paths:
  • /trunk/phase3/tests/phpunit/includes/db/DatabaseSqliteTest.php (modified) (history)
  • /trunk/phase3/tests/phpunit/includes/db/sqlite (added) (history)
  • /trunk/phase3/tests/phpunit/includes/db/sqlite/tables-1.13.sql (added) (history)
  • /trunk/phase3/tests/phpunit/includes/db/sqlite/tables-1.15.sql (added) (history)
  • /trunk/phase3/tests/phpunit/includes/db/sqlite/tables-1.16.sql (added) (history)
  • /trunk/phase3/tests/phpunit/includes/db/sqlite/tables-1.17.sql (added) (history)

Diff [purge]

Index: trunk/phase3/tests/phpunit/includes/db/sqlite/tables-1.13.sql
@@ -0,0 +1,342 @@
 2+-- This is a copy of SQLite schema from MediaWiki 1.13 used for updater testing
 3+
 4+CREATE TABLE /*$wgDBprefix*/user (
 5+ user_id INTEGER PRIMARY KEY AUTOINCREMENT,
 6+ user_name varchar(255) default '',
 7+ user_real_name varchar(255) default '',
 8+ user_password tinyblob ,
 9+ user_newpassword tinyblob ,
 10+ user_newpass_time BLOB,
 11+ user_email tinytext ,
 12+ user_options blob ,
 13+ user_touched BLOB default '',
 14+ user_token BLOB default '',
 15+ user_email_authenticated BLOB,
 16+ user_email_token BLOB,
 17+ user_email_token_expires BLOB,
 18+ user_registration BLOB,
 19+ user_editcount int) /*$wgDBTableOptions*/;
 20+
 21+CREATE TABLE /*$wgDBprefix*/user_groups (
 22+ ug_user INTEGER default '0',
 23+ ug_group varBLOB default '') /*$wgDBTableOptions*/;
 24+
 25+CREATE TABLE /*$wgDBprefix*/user_newtalk (
 26+ user_id INTEGER default '0',
 27+ user_ip varBLOB default '',
 28+ user_last_timestamp BLOB default '') /*$wgDBTableOptions*/;
 29+
 30+CREATE TABLE /*$wgDBprefix*/page (
 31+ page_id INTEGER PRIMARY KEY AUTOINCREMENT,
 32+ page_namespace INTEGER ,
 33+ page_title varchar(255) ,
 34+ page_restrictions tinyblob ,
 35+ page_counter bigint default '0',
 36+ page_is_redirect tinyint default '0',
 37+ page_is_new tinyint default '0',
 38+ page_random real ,
 39+ page_touched BLOB default '',
 40+ page_latest INTEGER ,
 41+ page_len INTEGER ) /*$wgDBTableOptions*/;
 42+
 43+CREATE TABLE /*$wgDBprefix*/revision (
 44+ rev_id INTEGER PRIMARY KEY AUTOINCREMENT,
 45+ rev_page INTEGER ,
 46+ rev_text_id INTEGER ,
 47+ rev_comment tinyblob ,
 48+ rev_user INTEGER default '0',
 49+ rev_user_text varchar(255) default '',
 50+ rev_timestamp BLOB default '',
 51+ rev_minor_edit tinyint default '0',
 52+ rev_deleted tinyint default '0',
 53+ rev_len int,
 54+ rev_parent_id INTEGER default NULL) /*$wgDBTableOptions*/ ;
 55+
 56+CREATE TABLE /*$wgDBprefix*/text (
 57+ old_id INTEGER PRIMARY KEY AUTOINCREMENT,
 58+ old_text mediumblob ,
 59+ old_flags tinyblob ) /*$wgDBTableOptions*/ ;
 60+
 61+CREATE TABLE /*$wgDBprefix*/archive (
 62+ ar_namespace INTEGER default '0',
 63+ ar_title varchar(255) default '',
 64+ ar_text mediumblob ,
 65+ ar_comment tinyblob ,
 66+ ar_user INTEGER default '0',
 67+ ar_user_text varchar(255) ,
 68+ ar_timestamp BLOB default '',
 69+ ar_minor_edit tinyint default '0',
 70+ ar_flags tinyblob ,
 71+ ar_rev_id int,
 72+ ar_text_id int,
 73+ ar_deleted tinyint default '0',
 74+ ar_len int,
 75+ ar_page_id int,
 76+ ar_parent_id INTEGER default NULL) /*$wgDBTableOptions*/;
 77+
 78+CREATE TABLE /*$wgDBprefix*/pagelinks (
 79+ pl_from INTEGER default '0',
 80+ pl_namespace INTEGER default '0',
 81+ pl_title varchar(255) default '') /*$wgDBTableOptions*/;
 82+
 83+CREATE TABLE /*$wgDBprefix*/templatelinks (
 84+ tl_from INTEGER default '0',
 85+ tl_namespace INTEGER default '0',
 86+ tl_title varchar(255) default '') /*$wgDBTableOptions*/;
 87+
 88+CREATE TABLE /*$wgDBprefix*/imagelinks (
 89+ il_from INTEGER default '0',
 90+ il_to varchar(255) default '') /*$wgDBTableOptions*/;
 91+
 92+CREATE TABLE /*$wgDBprefix*/categorylinks (
 93+ cl_from INTEGER default '0',
 94+ cl_to varchar(255) default '',
 95+ cl_sortkey varchar(70) default '',
 96+ cl_timestamp timestamp ) /*$wgDBTableOptions*/;
 97+
 98+CREATE TABLE /*$wgDBprefix*/category (
 99+ cat_id INTEGER PRIMARY KEY AUTOINCREMENT,
 100+ cat_title varchar(255) ,
 101+ cat_pages INTEGER signed default 0,
 102+ cat_subcats INTEGER signed default 0,
 103+ cat_files INTEGER signed default 0,
 104+ cat_hidden tinyint default 0) /*$wgDBTableOptions*/;
 105+
 106+CREATE TABLE /*$wgDBprefix*/externallinks (
 107+ el_from INTEGER default '0',
 108+ el_to blob ,
 109+ el_index blob ) /*$wgDBTableOptions*/;
 110+
 111+CREATE TABLE /*$wgDBprefix*/langlinks (
 112+ ll_from INTEGER default '0',
 113+ ll_lang varBLOB default '',
 114+ ll_title varchar(255) default '') /*$wgDBTableOptions*/;
 115+
 116+CREATE TABLE /*$wgDBprefix*/site_stats (
 117+ ss_row_id INTEGER ,
 118+ ss_total_views bigint default '0',
 119+ ss_total_edits bigint default '0',
 120+ ss_good_articles bigint default '0',
 121+ ss_total_pages bigint default '-1',
 122+ ss_users bigint default '-1',
 123+ ss_admins INTEGER default '-1',
 124+ ss_images INTEGER default '0') /*$wgDBTableOptions*/;
 125+
 126+CREATE TABLE /*$wgDBprefix*/hitcounter (
 127+ hc_id INTEGER
 128+) ;
 129+
 130+CREATE TABLE /*$wgDBprefix*/ipblocks (
 131+ ipb_id INTEGER PRIMARY KEY AUTOINCREMENT,
 132+ ipb_address tinyblob ,
 133+ ipb_user INTEGER default '0',
 134+ ipb_by INTEGER default '0',
 135+ ipb_by_text varchar(255) default '',
 136+ ipb_reason tinyblob ,
 137+ ipb_timestamp BLOB default '',
 138+ ipb_auto bool default 0,
 139+ ipb_anon_only bool default 0,
 140+ ipb_create_account bool default 1,
 141+ ipb_enable_autoblock bool default '1',
 142+ ipb_expiry varBLOB default '',
 143+ ipb_range_start tinyblob ,
 144+ ipb_range_end tinyblob ,
 145+ ipb_deleted bool default 0,
 146+ ipb_block_email bool default 0) /*$wgDBTableOptions*/;
 147+
 148+CREATE TABLE /*$wgDBprefix*/image (
 149+ img_name varchar(255) default '',
 150+ img_size INTEGER default '0',
 151+ img_width INTEGER default '0',
 152+ img_height INTEGER default '0',
 153+ img_metadata mediumblob ,
 154+ img_bits INTEGER default '0',
 155+ img_media_type TEXT default NULL,
 156+ img_major_mime TEXT default "unknown",
 157+ img_minor_mime varBLOB default "unknown",
 158+ img_description tinyblob ,
 159+ img_user INTEGER default '0',
 160+ img_user_text varchar(255) ,
 161+ img_timestamp varBLOB default '',
 162+ img_sha1 varBLOB default '') /*$wgDBTableOptions*/;
 163+
 164+CREATE TABLE /*$wgDBprefix*/oldimage (
 165+ oi_name varchar(255) default '',
 166+ oi_archive_name varchar(255) default '',
 167+ oi_size INTEGER default 0,
 168+ oi_width INTEGER default 0,
 169+ oi_height INTEGER default 0,
 170+ oi_bits INTEGER default 0,
 171+ oi_description tinyblob ,
 172+ oi_user INTEGER default '0',
 173+ oi_user_text varchar(255) ,
 174+ oi_timestamp BLOB default '',
 175+ oi_metadata mediumblob ,
 176+ oi_media_type TEXT default NULL,
 177+ oi_major_mime TEXT default "unknown",
 178+ oi_minor_mime varBLOB default "unknown",
 179+ oi_deleted tinyint default '0',
 180+ oi_sha1 varBLOB default '') /*$wgDBTableOptions*/;
 181+
 182+CREATE TABLE /*$wgDBprefix*/filearchive (
 183+ fa_id INTEGER PRIMARY KEY AUTOINCREMENT,
 184+ fa_name varchar(255) default '',
 185+ fa_archive_name varchar(255) default '',
 186+ fa_storage_group varBLOB,
 187+ fa_storage_key varBLOB default '',
 188+ fa_deleted_user int,
 189+ fa_deleted_timestamp BLOB default '',
 190+ fa_deleted_reason text,
 191+ fa_size INTEGER default '0',
 192+ fa_width INTEGER default '0',
 193+ fa_height INTEGER default '0',
 194+ fa_metadata mediumblob,
 195+ fa_bits INTEGER default '0',
 196+ fa_media_type TEXT default NULL,
 197+ fa_major_mime TEXT default "unknown",
 198+ fa_minor_mime varBLOB default "unknown",
 199+ fa_description tinyblob,
 200+ fa_user INTEGER default '0',
 201+ fa_user_text varchar(255) ,
 202+ fa_timestamp BLOB default '',
 203+ fa_deleted tinyint default '0') /*$wgDBTableOptions*/;
 204+
 205+CREATE TABLE /*$wgDBprefix*/recentchanges (
 206+ rc_id INTEGER PRIMARY KEY AUTOINCREMENT,
 207+ rc_timestamp varBLOB default '',
 208+ rc_cur_time varBLOB default '',
 209+ rc_user INTEGER default '0',
 210+ rc_user_text varchar(255) ,
 211+ rc_namespace INTEGER default '0',
 212+ rc_title varchar(255) default '',
 213+ rc_comment varchar(255) default '',
 214+ rc_minor tinyint default '0',
 215+ rc_bot tinyint default '0',
 216+ rc_new tinyint default '0',
 217+ rc_cur_id INTEGER default '0',
 218+ rc_this_oldid INTEGER default '0',
 219+ rc_last_oldid INTEGER default '0',
 220+ rc_type tinyint default '0',
 221+ rc_moved_to_ns tinyint default '0',
 222+ rc_moved_to_title varchar(255) default '',
 223+ rc_patrolled tinyint default '0',
 224+ rc_ip varBLOB default '',
 225+ rc_old_len int,
 226+ rc_new_len int,
 227+ rc_deleted tinyint default '0',
 228+ rc_logid INTEGER default '0',
 229+ rc_log_type varBLOB NULL default NULL,
 230+ rc_log_action varBLOB NULL default NULL,
 231+ rc_params blob NULL) /*$wgDBTableOptions*/;
 232+
 233+CREATE TABLE /*$wgDBprefix*/watchlist (
 234+ wl_user INTEGER ,
 235+ wl_namespace INTEGER default '0',
 236+ wl_title varchar(255) default '',
 237+ wl_notificationtimestamp varBLOB) /*$wgDBTableOptions*/;
 238+
 239+CREATE TABLE /*$wgDBprefix*/math (
 240+ math_inputhash varBLOB ,
 241+ math_outputhash varBLOB ,
 242+ math_html_conservativeness tinyint ,
 243+ math_html text,
 244+ math_mathml text) /*$wgDBTableOptions*/;
 245+
 246+CREATE TABLE /*$wgDBprefix*/searchindex (
 247+ si_page INTEGER ,
 248+ si_title varchar(255) default '',
 249+ si_text mediumtext ) ;
 250+
 251+CREATE TABLE /*$wgDBprefix*/interwiki (
 252+ iw_prefix varchar(32) ,
 253+ iw_url blob ,
 254+ iw_local bool ,
 255+ iw_trans tinyint default 0) /*$wgDBTableOptions*/;
 256+
 257+CREATE TABLE /*$wgDBprefix*/querycache (
 258+ qc_type varBLOB ,
 259+ qc_value INTEGER default '0',
 260+ qc_namespace INTEGER default '0',
 261+ qc_title varchar(255) default '') /*$wgDBTableOptions*/;
 262+
 263+CREATE TABLE /*$wgDBprefix*/objectcache (
 264+ keyname varBLOB default '',
 265+ value mediumblob,
 266+ exptime datetime) /*$wgDBTableOptions*/;
 267+
 268+CREATE TABLE /*$wgDBprefix*/transcache (
 269+ tc_url varBLOB ,
 270+ tc_contents text,
 271+ tc_time INTEGER ) /*$wgDBTableOptions*/;
 272+
 273+CREATE TABLE /*$wgDBprefix*/logging (
 274+ log_id INTEGER PRIMARY KEY AUTOINCREMENT,
 275+ log_type varBLOB default '',
 276+ log_action varBLOB default '',
 277+ log_timestamp BLOB default '19700101000000',
 278+ log_user INTEGER default 0,
 279+ log_namespace INTEGER default 0,
 280+ log_title varchar(255) default '',
 281+ log_comment varchar(255) default '',
 282+ log_params blob ,
 283+ log_deleted tinyint default '0') /*$wgDBTableOptions*/;
 284+
 285+CREATE TABLE /*$wgDBprefix*/trackbacks (
 286+ tb_id INTEGER PRIMARY KEY AUTOINCREMENT,
 287+ tb_page INTEGER REFERENCES /*$wgDBprefix*/page(page_id) ON DELETE CASCADE,
 288+ tb_title varchar(255) ,
 289+ tb_url blob ,
 290+ tb_ex text,
 291+ tb_name varchar(255)) /*$wgDBTableOptions*/;
 292+
 293+CREATE TABLE /*$wgDBprefix*/job (
 294+ job_id INTEGER PRIMARY KEY AUTOINCREMENT,
 295+ job_cmd varBLOB default '',
 296+ job_namespace INTEGER ,
 297+ job_title varchar(255) ,
 298+ job_params blob ) /*$wgDBTableOptions*/;
 299+
 300+CREATE TABLE /*$wgDBprefix*/querycache_info (
 301+ qci_type varBLOB default '',
 302+ qci_timestamp BLOB default '19700101000000') /*$wgDBTableOptions*/;
 303+
 304+CREATE TABLE /*$wgDBprefix*/redirect (
 305+ rd_from INTEGER default '0',
 306+ rd_namespace INTEGER default '0',
 307+ rd_title varchar(255) default '') /*$wgDBTableOptions*/;
 308+
 309+CREATE TABLE /*$wgDBprefix*/querycachetwo (
 310+ qcc_type varBLOB ,
 311+ qcc_value INTEGER default '0',
 312+ qcc_namespace INTEGER default '0',
 313+ qcc_title varchar(255) default '',
 314+ qcc_namespacetwo INTEGER default '0',
 315+ qcc_titletwo varchar(255) default '') /*$wgDBTableOptions*/;
 316+
 317+CREATE TABLE /*$wgDBprefix*/page_restrictions (
 318+ pr_page INTEGER ,
 319+ pr_type varBLOB ,
 320+ pr_level varBLOB ,
 321+ pr_cascade tinyint ,
 322+ pr_user INTEGER NULL,
 323+ pr_expiry varBLOB NULL,
 324+ pr_id INTEGER PRIMARY KEY AUTOINCREMENT) /*$wgDBTableOptions*/;
 325+
 326+CREATE TABLE /*$wgDBprefix*/protected_titles (
 327+ pt_namespace INTEGER ,
 328+ pt_title varchar(255) ,
 329+ pt_user INTEGER ,
 330+ pt_reason tinyblob,
 331+ pt_timestamp BLOB ,
 332+ pt_expiry varBLOB default '',
 333+ pt_create_perm varBLOB ) /*$wgDBTableOptions*/;
 334+
 335+CREATE TABLE /*$wgDBprefix*/page_props (
 336+ pp_page INTEGER ,
 337+ pp_propname varBLOB ,
 338+ pp_value blob ) /*$wgDBTableOptions*/;
 339+
 340+CREATE TABLE /*$wgDBprefix*/updatelog (
 341+ ul_key varchar(255) ) /*$wgDBTableOptions*/;
 342+
 343+
Index: trunk/phase3/tests/phpunit/includes/db/sqlite/tables-1.15.sql
@@ -0,0 +1,454 @@
 2+-- This is a copy of MediaWiki 1.15 schema shared by MySQL and SQLite.
 3+-- It is used for updater testing. Comments are stripped to decrease
 4+-- file size, as we don't need to maintain it.
 5+
 6+CREATE TABLE /*_*/user (
 7+ user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 8+ user_name varchar(255) binary NOT NULL default '',
 9+ user_real_name varchar(255) binary NOT NULL default '',
 10+ user_password tinyblob NOT NULL,
 11+ user_newpassword tinyblob NOT NULL,
 12+ user_newpass_time binary(14),
 13+ user_email tinytext NOT NULL,
 14+ user_options blob NOT NULL,
 15+ user_touched binary(14) NOT NULL default '',
 16+ user_token binary(32) NOT NULL default '',
 17+ user_email_authenticated binary(14),
 18+ user_email_token binary(32),
 19+ user_email_token_expires binary(14),
 20+ user_registration binary(14),
 21+ user_editcount int
 22+) /*$wgDBTableOptions*/;
 23+CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name);
 24+CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token);
 25+CREATE TABLE /*_*/user_groups (
 26+ ug_user int unsigned NOT NULL default 0,
 27+ ug_group varbinary(16) NOT NULL default ''
 28+) /*$wgDBTableOptions*/;
 29+CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group);
 30+CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
 31+CREATE TABLE /*_*/user_newtalk (
 32+ user_id int NOT NULL default 0,
 33+ user_ip varbinary(40) NOT NULL default '',
 34+ user_last_timestamp binary(14) NOT NULL default ''
 35+) /*$wgDBTableOptions*/;
 36+CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id);
 37+CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip);
 38+CREATE TABLE /*_*/page (
 39+ page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 40+ page_namespace int NOT NULL,
 41+ page_title varchar(255) binary NOT NULL,
 42+ page_restrictions tinyblob NOT NULL,
 43+ page_counter bigint unsigned NOT NULL default 0,
 44+ page_is_redirect tinyint unsigned NOT NULL default 0,
 45+ page_is_new tinyint unsigned NOT NULL default 0,
 46+ page_random real unsigned NOT NULL,
 47+ page_touched binary(14) NOT NULL default '',
 48+ page_latest int unsigned NOT NULL,
 49+ page_len int unsigned NOT NULL
 50+) /*$wgDBTableOptions*/;
 51+CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title);
 52+CREATE INDEX /*i*/page_random ON /*_*/page (page_random);
 53+CREATE INDEX /*i*/page_len ON /*_*/page (page_len);
 54+CREATE TABLE /*_*/revision (
 55+ rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 56+ rev_page int unsigned NOT NULL,
 57+ rev_text_id int unsigned NOT NULL,
 58+ rev_comment tinyblob NOT NULL,
 59+ rev_user int unsigned NOT NULL default 0,
 60+ rev_user_text varchar(255) binary NOT NULL default '',
 61+ rev_timestamp binary(14) NOT NULL default '',
 62+ rev_minor_edit tinyint unsigned NOT NULL default 0,
 63+ rev_deleted tinyint unsigned NOT NULL default 0,
 64+ rev_len int unsigned,
 65+ rev_parent_id int unsigned default NULL
 66+) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
 67+CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id);
 68+CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp);
 69+CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp);
 70+CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp);
 71+CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp);
 72+CREATE TABLE /*_*/text (
 73+ old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 74+ old_text mediumblob NOT NULL,
 75+ old_flags tinyblob NOT NULL
 76+) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;
 77+CREATE TABLE /*_*/archive (
 78+ ar_namespace int NOT NULL default 0,
 79+ ar_title varchar(255) binary NOT NULL default '',
 80+ ar_text mediumblob NOT NULL,
 81+ ar_comment tinyblob NOT NULL,
 82+ ar_user int unsigned NOT NULL default 0,
 83+ ar_user_text varchar(255) binary NOT NULL,
 84+ ar_timestamp binary(14) NOT NULL default '',
 85+ ar_minor_edit tinyint NOT NULL default 0,
 86+ ar_flags tinyblob NOT NULL,
 87+ ar_rev_id int unsigned,
 88+ ar_text_id int unsigned,
 89+ ar_deleted tinyint unsigned NOT NULL default 0,
 90+ ar_len int unsigned,
 91+ ar_page_id int unsigned,
 92+ ar_parent_id int unsigned default NULL
 93+) /*$wgDBTableOptions*/;
 94+CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp);
 95+CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp);
 96+CREATE TABLE /*_*/pagelinks (
 97+ pl_from int unsigned NOT NULL default 0,
 98+ pl_namespace int NOT NULL default 0,
 99+ pl_title varchar(255) binary NOT NULL default ''
 100+) /*$wgDBTableOptions*/;
 101+CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title);
 102+CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from);
 103+CREATE TABLE /*_*/templatelinks (
 104+ tl_from int unsigned NOT NULL default 0,
 105+ tl_namespace int NOT NULL default 0,
 106+ tl_title varchar(255) binary NOT NULL default ''
 107+) /*$wgDBTableOptions*/;
 108+CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title);
 109+CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from);
 110+CREATE TABLE /*_*/imagelinks (
 111+ il_from int unsigned NOT NULL default 0,
 112+ il_to varchar(255) binary NOT NULL default ''
 113+) /*$wgDBTableOptions*/;
 114+CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to);
 115+CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from);
 116+CREATE TABLE /*_*/categorylinks (
 117+ cl_from int unsigned NOT NULL default 0,
 118+ cl_to varchar(255) binary NOT NULL default '',
 119+ cl_sortkey varchar(70) binary NOT NULL default '',
 120+ cl_timestamp timestamp NOT NULL
 121+) /*$wgDBTableOptions*/;
 122+CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to);
 123+CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_sortkey,cl_from);
 124+CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp);
 125+CREATE TABLE /*_*/category (
 126+ cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 127+ cat_title varchar(255) binary NOT NULL,
 128+ cat_pages int signed NOT NULL default 0,
 129+ cat_subcats int signed NOT NULL default 0,
 130+ cat_files int signed NOT NULL default 0,
 131+ cat_hidden tinyint unsigned NOT NULL default 0
 132+) /*$wgDBTableOptions*/;
 133+CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title);
 134+CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages);
 135+CREATE TABLE /*_*/externallinks (
 136+ el_from int unsigned NOT NULL default 0,
 137+ el_to blob NOT NULL,
 138+ el_index blob NOT NULL
 139+) /*$wgDBTableOptions*/;
 140+CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40));
 141+CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from);
 142+CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60));
 143+CREATE TABLE /*_*/langlinks (
 144+ ll_from int unsigned NOT NULL default 0,
 145+
 146+ ll_lang varbinary(20) NOT NULL default '',
 147+ ll_title varchar(255) binary NOT NULL default ''
 148+) /*$wgDBTableOptions*/;
 149+CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang);
 150+CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title);
 151+CREATE TABLE /*_*/site_stats (
 152+ ss_row_id int unsigned NOT NULL,
 153+ ss_total_views bigint unsigned default 0,
 154+ ss_total_edits bigint unsigned default 0,
 155+ ss_good_articles bigint unsigned default 0,
 156+ ss_total_pages bigint default '-1',
 157+ ss_users bigint default '-1',
 158+ ss_active_users bigint default '-1',
 159+ ss_admins int default '-1',
 160+ ss_images int default 0
 161+) /*$wgDBTableOptions*/;
 162+CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
 163+CREATE TABLE /*_*/hitcounter (
 164+ hc_id int unsigned NOT NULL
 165+) ENGINE=HEAP MAX_ROWS=25000;
 166+CREATE TABLE /*_*/ipblocks (
 167+ ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 168+ ipb_address tinyblob NOT NULL,
 169+ ipb_user int unsigned NOT NULL default 0,
 170+ ipb_by int unsigned NOT NULL default 0,
 171+ ipb_by_text varchar(255) binary NOT NULL default '',
 172+ ipb_reason tinyblob NOT NULL,
 173+ ipb_timestamp binary(14) NOT NULL default '',
 174+ ipb_auto bool NOT NULL default 0,
 175+ ipb_anon_only bool NOT NULL default 0,
 176+ ipb_create_account bool NOT NULL default 1,
 177+ ipb_enable_autoblock bool NOT NULL default '1',
 178+ ipb_expiry varbinary(14) NOT NULL default '',
 179+ ipb_range_start tinyblob NOT NULL,
 180+ ipb_range_end tinyblob NOT NULL,
 181+ ipb_deleted bool NOT NULL default 0,
 182+ ipb_block_email bool NOT NULL default 0,
 183+ ipb_allow_usertalk bool NOT NULL default 0
 184+) /*$wgDBTableOptions*/;
 185+
 186+CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
 187+CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user);
 188+CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8));
 189+CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp);
 190+CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry);
 191+CREATE TABLE /*_*/image (
 192+ img_name varchar(255) binary NOT NULL default '' PRIMARY KEY,
 193+ img_size int unsigned NOT NULL default 0,
 194+ img_width int NOT NULL default 0,
 195+ img_height int NOT NULL default 0,
 196+ img_metadata mediumblob NOT NULL,
 197+ img_bits int NOT NULL default 0,
 198+ img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 199+ img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
 200+ img_minor_mime varbinary(32) NOT NULL default "unknown",
 201+ img_description tinyblob NOT NULL,
 202+ img_user int unsigned NOT NULL default 0,
 203+ img_user_text varchar(255) binary NOT NULL,
 204+ img_timestamp varbinary(14) NOT NULL default '',
 205+ img_sha1 varbinary(32) NOT NULL default ''
 206+) /*$wgDBTableOptions*/;
 207+CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp);
 208+CREATE INDEX /*i*/img_size ON /*_*/image (img_size);
 209+CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp);
 210+CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1);
 211+CREATE TABLE /*_*/oldimage (
 212+ oi_name varchar(255) binary NOT NULL default '',
 213+ oi_archive_name varchar(255) binary NOT NULL default '',
 214+ oi_size int unsigned NOT NULL default 0,
 215+ oi_width int NOT NULL default 0,
 216+ oi_height int NOT NULL default 0,
 217+ oi_bits int NOT NULL default 0,
 218+ oi_description tinyblob NOT NULL,
 219+ oi_user int unsigned NOT NULL default 0,
 220+ oi_user_text varchar(255) binary NOT NULL,
 221+ oi_timestamp binary(14) NOT NULL default '',
 222+ oi_metadata mediumblob NOT NULL,
 223+ oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 224+ oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
 225+ oi_minor_mime varbinary(32) NOT NULL default "unknown",
 226+ oi_deleted tinyint unsigned NOT NULL default 0,
 227+ oi_sha1 varbinary(32) NOT NULL default ''
 228+) /*$wgDBTableOptions*/;
 229+CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp);
 230+CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp);
 231+CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14));
 232+CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1);
 233+CREATE TABLE /*_*/filearchive (
 234+ fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 235+ fa_name varchar(255) binary NOT NULL default '',
 236+ fa_archive_name varchar(255) binary default '',
 237+ fa_storage_group varbinary(16),
 238+ fa_storage_key varbinary(64) default '',
 239+ fa_deleted_user int,
 240+ fa_deleted_timestamp binary(14) default '',
 241+ fa_deleted_reason text,
 242+ fa_size int unsigned default 0,
 243+ fa_width int default 0,
 244+ fa_height int default 0,
 245+ fa_metadata mediumblob,
 246+ fa_bits int default 0,
 247+ fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 248+ fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
 249+ fa_minor_mime varbinary(32) default "unknown",
 250+ fa_description tinyblob,
 251+ fa_user int unsigned default 0,
 252+ fa_user_text varchar(255) binary,
 253+ fa_timestamp binary(14) default '',
 254+ fa_deleted tinyint unsigned NOT NULL default 0
 255+) /*$wgDBTableOptions*/;
 256+CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
 257+CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key);
 258+CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
 259+CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp);
 260+CREATE TABLE /*_*/recentchanges (
 261+ rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 262+ rc_timestamp varbinary(14) NOT NULL default '',
 263+ rc_cur_time varbinary(14) NOT NULL default '',
 264+ rc_user int unsigned NOT NULL default 0,
 265+ rc_user_text varchar(255) binary NOT NULL,
 266+ rc_namespace int NOT NULL default 0,
 267+ rc_title varchar(255) binary NOT NULL default '',
 268+ rc_comment varchar(255) binary NOT NULL default '',
 269+ rc_minor tinyint unsigned NOT NULL default 0,
 270+ rc_bot tinyint unsigned NOT NULL default 0,
 271+ rc_new tinyint unsigned NOT NULL default 0,
 272+ rc_cur_id int unsigned NOT NULL default 0,
 273+ rc_this_oldid int unsigned NOT NULL default 0,
 274+ rc_last_oldid int unsigned NOT NULL default 0,
 275+ rc_type tinyint unsigned NOT NULL default 0,
 276+ rc_moved_to_ns tinyint unsigned NOT NULL default 0,
 277+ rc_moved_to_title varchar(255) binary NOT NULL default '',
 278+ rc_patrolled tinyint unsigned NOT NULL default 0,
 279+ rc_ip varbinary(40) NOT NULL default '',
 280+ rc_old_len int,
 281+ rc_new_len int,
 282+ rc_deleted tinyint unsigned NOT NULL default 0,
 283+ rc_logid int unsigned NOT NULL default 0,
 284+ rc_log_type varbinary(255) NULL default NULL,
 285+ rc_log_action varbinary(255) NULL default NULL,
 286+ rc_params blob NULL
 287+) /*$wgDBTableOptions*/;
 288+CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp);
 289+CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title);
 290+CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id);
 291+CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp);
 292+CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip);
 293+CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
 294+CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
 295+CREATE TABLE /*_*/watchlist (
 296+ wl_user int unsigned NOT NULL,
 297+ wl_namespace int NOT NULL default 0,
 298+ wl_title varchar(255) binary NOT NULL default '',
 299+ wl_notificationtimestamp varbinary(14)
 300+) /*$wgDBTableOptions*/;
 301+CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
 302+CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
 303+CREATE TABLE /*_*/math (
 304+ math_inputhash varbinary(16) NOT NULL,
 305+ math_outputhash varbinary(16) NOT NULL,
 306+ math_html_conservativeness tinyint NOT NULL,
 307+ math_html text,
 308+ math_mathml text
 309+) /*$wgDBTableOptions*/;
 310+CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math (math_inputhash);
 311+CREATE TABLE /*_*/searchindex (
 312+ si_page int unsigned NOT NULL,
 313+ si_title varchar(255) NOT NULL default '',
 314+ si_text mediumtext NOT NULL
 315+) ENGINE=MyISAM;
 316+CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page);
 317+CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title);
 318+CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text);
 319+CREATE TABLE /*_*/interwiki (
 320+ iw_prefix varchar(32) NOT NULL,
 321+ iw_url blob NOT NULL,
 322+ iw_local bool NOT NULL,
 323+ iw_trans tinyint NOT NULL default 0
 324+) /*$wgDBTableOptions*/;
 325+CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix);
 326+CREATE TABLE /*_*/querycache (
 327+ qc_type varbinary(32) NOT NULL,
 328+ qc_value int unsigned NOT NULL default 0,
 329+ qc_namespace int NOT NULL default 0,
 330+ qc_title varchar(255) binary NOT NULL default ''
 331+) /*$wgDBTableOptions*/;
 332+CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value);
 333+CREATE TABLE /*_*/objectcache (
 334+ keyname varbinary(255) NOT NULL default '' PRIMARY KEY,
 335+ value mediumblob,
 336+ exptime datetime
 337+) /*$wgDBTableOptions*/;
 338+CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime);
 339+CREATE TABLE /*_*/transcache (
 340+ tc_url varbinary(255) NOT NULL,
 341+ tc_contents text,
 342+ tc_time int NOT NULL
 343+) /*$wgDBTableOptions*/;
 344+CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url);
 345+CREATE TABLE /*_*/logging (
 346+ log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 347+ log_type varbinary(10) NOT NULL default '',
 348+ log_action varbinary(10) NOT NULL default '',
 349+ log_timestamp binary(14) NOT NULL default '19700101000000',
 350+ log_user int unsigned NOT NULL default 0,
 351+ log_namespace int NOT NULL default 0,
 352+ log_title varchar(255) binary NOT NULL default '',
 353+ log_comment varchar(255) NOT NULL default '',
 354+ log_params blob NOT NULL,
 355+ log_deleted tinyint unsigned NOT NULL default 0
 356+) /*$wgDBTableOptions*/;
 357+CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp);
 358+CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp);
 359+CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp);
 360+CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp);
 361+CREATE TABLE /*_*/trackbacks (
 362+ tb_id int PRIMARY KEY AUTO_INCREMENT,
 363+ tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE,
 364+ tb_title varchar(255) NOT NULL,
 365+ tb_url blob NOT NULL,
 366+ tb_ex text,
 367+ tb_name varchar(255)
 368+) /*$wgDBTableOptions*/;
 369+CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page);
 370+CREATE TABLE /*_*/job (
 371+ job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 372+ job_cmd varbinary(60) NOT NULL default '',
 373+ job_namespace int NOT NULL,
 374+ job_title varchar(255) binary NOT NULL,
 375+ job_params blob NOT NULL
 376+) /*$wgDBTableOptions*/;
 377+CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title);
 378+CREATE TABLE /*_*/querycache_info (
 379+ qci_type varbinary(32) NOT NULL default '',
 380+ qci_timestamp binary(14) NOT NULL default '19700101000000'
 381+) /*$wgDBTableOptions*/;
 382+CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type);
 383+CREATE TABLE /*_*/redirect (
 384+ rd_from int unsigned NOT NULL default 0 PRIMARY KEY,
 385+ rd_namespace int NOT NULL default 0,
 386+ rd_title varchar(255) binary NOT NULL default ''
 387+) /*$wgDBTableOptions*/;
 388+CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from);
 389+CREATE TABLE /*_*/querycachetwo (
 390+ qcc_type varbinary(32) NOT NULL,
 391+ qcc_value int unsigned NOT NULL default 0,
 392+ qcc_namespace int NOT NULL default 0,
 393+ qcc_title varchar(255) binary NOT NULL default '',
 394+ qcc_namespacetwo int NOT NULL default 0,
 395+ qcc_titletwo varchar(255) binary NOT NULL default ''
 396+) /*$wgDBTableOptions*/;
 397+CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value);
 398+CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title);
 399+CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo);
 400+CREATE TABLE /*_*/page_restrictions (
 401+ pr_page int NOT NULL,
 402+ pr_type varbinary(60) NOT NULL,
 403+ pr_level varbinary(60) NOT NULL,
 404+ pr_cascade tinyint NOT NULL,
 405+ pr_user int NULL,
 406+ pr_expiry varbinary(14) NULL,
 407+ pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT
 408+) /*$wgDBTableOptions*/;
 409+CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type);
 410+CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level);
 411+CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level);
 412+CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade);
 413+CREATE TABLE /*_*/protected_titles (
 414+ pt_namespace int NOT NULL,
 415+ pt_title varchar(255) binary NOT NULL,
 416+ pt_user int unsigned NOT NULL,
 417+ pt_reason tinyblob,
 418+ pt_timestamp binary(14) NOT NULL,
 419+ pt_expiry varbinary(14) NOT NULL default '',
 420+ pt_create_perm varbinary(60) NOT NULL
 421+) /*$wgDBTableOptions*/;
 422+CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title);
 423+CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp);
 424+CREATE TABLE /*_*/page_props (
 425+ pp_page int NOT NULL,
 426+ pp_propname varbinary(60) NOT NULL,
 427+ pp_value blob NOT NULL
 428+) /*$wgDBTableOptions*/;
 429+CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname);
 430+CREATE TABLE /*_*/updatelog (
 431+ ul_key varchar(255) NOT NULL PRIMARY KEY
 432+) /*$wgDBTableOptions*/;
 433+CREATE TABLE /*_*/change_tag (
 434+ ct_rc_id int NULL,
 435+ ct_log_id int NULL,
 436+ ct_rev_id int NULL,
 437+ ct_tag varchar(255) NOT NULL,
 438+ ct_params blob NULL
 439+) /*$wgDBTableOptions*/;
 440+CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag);
 441+CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag);
 442+CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag);
 443+CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id);
 444+CREATE TABLE /*_*/tag_summary (
 445+ ts_rc_id int NULL,
 446+ ts_log_id int NULL,
 447+ ts_rev_id int NULL,
 448+ ts_tags blob NOT NULL
 449+) /*$wgDBTableOptions*/;
 450+CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id);
 451+CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id);
 452+CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id);
 453+CREATE TABLE /*_*/valid_tag (
 454+ vt_tag varchar(255) NOT NULL PRIMARY KEY
 455+) /*$wgDBTableOptions*/;
Index: trunk/phase3/tests/phpunit/includes/db/sqlite/tables-1.16.sql
@@ -0,0 +1,483 @@
 2+-- This is a copy of MediaWiki 1.16 schema shared by MySQL and SQLite.
 3+-- It is used for updater testing. Comments are stripped to decrease
 4+-- file size, as we don't need to maintain it.
 5+
 6+CREATE TABLE /*_*/user (
 7+ user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 8+ user_name varchar(255) binary NOT NULL default '',
 9+ user_real_name varchar(255) binary NOT NULL default '',
 10+ user_password tinyblob NOT NULL,
 11+ user_newpassword tinyblob NOT NULL,
 12+ user_newpass_time binary(14),
 13+ user_email tinytext NOT NULL,
 14+ user_options blob NOT NULL,
 15+ user_touched binary(14) NOT NULL default '',
 16+ user_token binary(32) NOT NULL default '',
 17+ user_email_authenticated binary(14),
 18+ user_email_token binary(32),
 19+ user_email_token_expires binary(14),
 20+ user_registration binary(14),
 21+ user_editcount int
 22+) /*$wgDBTableOptions*/;
 23+CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name);
 24+CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token);
 25+CREATE TABLE /*_*/user_groups (
 26+ ug_user int unsigned NOT NULL default 0,
 27+ ug_group varbinary(16) NOT NULL default ''
 28+) /*$wgDBTableOptions*/;
 29+CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group);
 30+CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
 31+CREATE TABLE /*_*/user_newtalk (
 32+ user_id int NOT NULL default 0,
 33+ user_ip varbinary(40) NOT NULL default '',
 34+ user_last_timestamp binary(14) NOT NULL default ''
 35+) /*$wgDBTableOptions*/;
 36+CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id);
 37+CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip);
 38+CREATE TABLE /*_*/user_properties (
 39+ up_user int NOT NULL,
 40+ up_property varbinary(32) NOT NULL,
 41+ up_value blob
 42+) /*$wgDBTableOptions*/;
 43+CREATE UNIQUE INDEX /*i*/user_properties_user_property ON /*_*/user_properties (up_user,up_property);
 44+CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property);
 45+CREATE TABLE /*_*/page (
 46+ page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 47+ page_namespace int NOT NULL,
 48+ page_title varchar(255) binary NOT NULL,
 49+ page_restrictions tinyblob NOT NULL,
 50+ page_counter bigint unsigned NOT NULL default 0,
 51+ page_is_redirect tinyint unsigned NOT NULL default 0,
 52+ page_is_new tinyint unsigned NOT NULL default 0,
 53+ page_random real unsigned NOT NULL,
 54+ page_touched binary(14) NOT NULL default '',
 55+ page_latest int unsigned NOT NULL,
 56+ page_len int unsigned NOT NULL
 57+) /*$wgDBTableOptions*/;
 58+CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title);
 59+CREATE INDEX /*i*/page_random ON /*_*/page (page_random);
 60+CREATE INDEX /*i*/page_len ON /*_*/page (page_len);
 61+CREATE TABLE /*_*/revision (
 62+ rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 63+ rev_page int unsigned NOT NULL,
 64+ rev_text_id int unsigned NOT NULL,
 65+ rev_comment tinyblob NOT NULL,
 66+ rev_user int unsigned NOT NULL default 0,
 67+ rev_user_text varchar(255) binary NOT NULL default '',
 68+ rev_timestamp binary(14) NOT NULL default '',
 69+ rev_minor_edit tinyint unsigned NOT NULL default 0,
 70+ rev_deleted tinyint unsigned NOT NULL default 0,
 71+ rev_len int unsigned,
 72+ rev_parent_id int unsigned default NULL
 73+) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
 74+CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id);
 75+CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp);
 76+CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp);
 77+CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp);
 78+CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp);
 79+CREATE TABLE /*_*/text (
 80+ old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 81+ old_text mediumblob NOT NULL,
 82+ old_flags tinyblob NOT NULL
 83+) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;
 84+CREATE TABLE /*_*/archive (
 85+ ar_namespace int NOT NULL default 0,
 86+ ar_title varchar(255) binary NOT NULL default '',
 87+ ar_text mediumblob NOT NULL,
 88+ ar_comment tinyblob NOT NULL,
 89+ ar_user int unsigned NOT NULL default 0,
 90+ ar_user_text varchar(255) binary NOT NULL,
 91+ ar_timestamp binary(14) NOT NULL default '',
 92+ ar_minor_edit tinyint NOT NULL default 0,
 93+ ar_flags tinyblob NOT NULL,
 94+ ar_rev_id int unsigned,
 95+ ar_text_id int unsigned,
 96+ ar_deleted tinyint unsigned NOT NULL default 0,
 97+ ar_len int unsigned,
 98+ ar_page_id int unsigned,
 99+ ar_parent_id int unsigned default NULL
 100+) /*$wgDBTableOptions*/;
 101+CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp);
 102+CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp);
 103+CREATE TABLE /*_*/pagelinks (
 104+ pl_from int unsigned NOT NULL default 0,
 105+ pl_namespace int NOT NULL default 0,
 106+ pl_title varchar(255) binary NOT NULL default ''
 107+) /*$wgDBTableOptions*/;
 108+CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title);
 109+CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from);
 110+CREATE TABLE /*_*/templatelinks (
 111+ tl_from int unsigned NOT NULL default 0,
 112+ tl_namespace int NOT NULL default 0,
 113+ tl_title varchar(255) binary NOT NULL default ''
 114+) /*$wgDBTableOptions*/;
 115+CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title);
 116+CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from);
 117+CREATE TABLE /*_*/imagelinks (
 118+ il_from int unsigned NOT NULL default 0,
 119+ il_to varchar(255) binary NOT NULL default ''
 120+) /*$wgDBTableOptions*/;
 121+CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to);
 122+CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from);
 123+CREATE TABLE /*_*/categorylinks (
 124+ cl_from int unsigned NOT NULL default 0,
 125+ cl_to varchar(255) binary NOT NULL default '',
 126+ cl_sortkey varchar(70) binary NOT NULL default '',
 127+ cl_timestamp timestamp NOT NULL
 128+) /*$wgDBTableOptions*/;
 129+CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to);
 130+CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_sortkey,cl_from);
 131+CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp);
 132+CREATE TABLE /*_*/category (
 133+ cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 134+ cat_title varchar(255) binary NOT NULL,
 135+ cat_pages int signed NOT NULL default 0,
 136+ cat_subcats int signed NOT NULL default 0,
 137+ cat_files int signed NOT NULL default 0,
 138+ cat_hidden tinyint unsigned NOT NULL default 0
 139+) /*$wgDBTableOptions*/;
 140+CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title);
 141+CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages);
 142+CREATE TABLE /*_*/externallinks (
 143+ el_from int unsigned NOT NULL default 0,
 144+ el_to blob NOT NULL,
 145+ el_index blob NOT NULL
 146+) /*$wgDBTableOptions*/;
 147+CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40));
 148+CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from);
 149+CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60));
 150+CREATE TABLE /*_*/external_user (
 151+ eu_local_id int unsigned NOT NULL PRIMARY KEY,
 152+ eu_external_id varchar(255) binary NOT NULL
 153+) /*$wgDBTableOptions*/;
 154+CREATE UNIQUE INDEX /*i*/eu_external_id ON /*_*/external_user (eu_external_id);
 155+CREATE TABLE /*_*/langlinks (
 156+ ll_from int unsigned NOT NULL default 0,
 157+ ll_lang varbinary(20) NOT NULL default '',
 158+ ll_title varchar(255) binary NOT NULL default ''
 159+) /*$wgDBTableOptions*/;
 160+CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang);
 161+CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title);
 162+CREATE TABLE /*_*/site_stats (
 163+ ss_row_id int unsigned NOT NULL,
 164+ ss_total_views bigint unsigned default 0,
 165+ ss_total_edits bigint unsigned default 0,
 166+ ss_good_articles bigint unsigned default 0,
 167+ ss_total_pages bigint default '-1',
 168+ ss_users bigint default '-1',
 169+ ss_active_users bigint default '-1',
 170+ ss_admins int default '-1',
 171+ ss_images int default 0
 172+) /*$wgDBTableOptions*/;
 173+CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
 174+CREATE TABLE /*_*/hitcounter (
 175+ hc_id int unsigned NOT NULL
 176+) ENGINE=HEAP MAX_ROWS=25000;
 177+CREATE TABLE /*_*/ipblocks (
 178+ ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 179+ ipb_address tinyblob NOT NULL,
 180+ ipb_user int unsigned NOT NULL default 0,
 181+ ipb_by int unsigned NOT NULL default 0,
 182+ ipb_by_text varchar(255) binary NOT NULL default '',
 183+ ipb_reason tinyblob NOT NULL,
 184+ ipb_timestamp binary(14) NOT NULL default '',
 185+ ipb_auto bool NOT NULL default 0,
 186+ ipb_anon_only bool NOT NULL default 0,
 187+ ipb_create_account bool NOT NULL default 1,
 188+ ipb_enable_autoblock bool NOT NULL default '1',
 189+ ipb_expiry varbinary(14) NOT NULL default '',
 190+ ipb_range_start tinyblob NOT NULL,
 191+ ipb_range_end tinyblob NOT NULL,
 192+ ipb_deleted bool NOT NULL default 0,
 193+ ipb_block_email bool NOT NULL default 0,
 194+ ipb_allow_usertalk bool NOT NULL default 0
 195+) /*$wgDBTableOptions*/;
 196+CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
 197+CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user);
 198+CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8));
 199+CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp);
 200+CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry);
 201+CREATE TABLE /*_*/image (
 202+ img_name varchar(255) binary NOT NULL default '' PRIMARY KEY,
 203+ img_size int unsigned NOT NULL default 0,
 204+ img_width int NOT NULL default 0,
 205+ img_height int NOT NULL default 0,
 206+ img_metadata mediumblob NOT NULL,
 207+ img_bits int NOT NULL default 0,
 208+ img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 209+ img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
 210+ img_minor_mime varbinary(100) NOT NULL default "unknown",
 211+ img_description tinyblob NOT NULL,
 212+ img_user int unsigned NOT NULL default 0,
 213+ img_user_text varchar(255) binary NOT NULL,
 214+ img_timestamp varbinary(14) NOT NULL default '',
 215+ img_sha1 varbinary(32) NOT NULL default ''
 216+) /*$wgDBTableOptions*/;
 217+CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp);
 218+CREATE INDEX /*i*/img_size ON /*_*/image (img_size);
 219+CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp);
 220+CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1);
 221+CREATE TABLE /*_*/oldimage (
 222+ oi_name varchar(255) binary NOT NULL default '',
 223+ oi_archive_name varchar(255) binary NOT NULL default '',
 224+ oi_size int unsigned NOT NULL default 0,
 225+ oi_width int NOT NULL default 0,
 226+ oi_height int NOT NULL default 0,
 227+ oi_bits int NOT NULL default 0,
 228+ oi_description tinyblob NOT NULL,
 229+ oi_user int unsigned NOT NULL default 0,
 230+ oi_user_text varchar(255) binary NOT NULL,
 231+ oi_timestamp binary(14) NOT NULL default '',
 232+ oi_metadata mediumblob NOT NULL,
 233+ oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 234+ oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
 235+ oi_minor_mime varbinary(100) NOT NULL default "unknown",
 236+ oi_deleted tinyint unsigned NOT NULL default 0,
 237+ oi_sha1 varbinary(32) NOT NULL default ''
 238+) /*$wgDBTableOptions*/;
 239+CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp);
 240+CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp);
 241+CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14));
 242+CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1);
 243+CREATE TABLE /*_*/filearchive (
 244+ fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 245+ fa_name varchar(255) binary NOT NULL default '',
 246+ fa_archive_name varchar(255) binary default '',
 247+ fa_storage_group varbinary(16),
 248+ fa_storage_key varbinary(64) default '',
 249+ fa_deleted_user int,
 250+ fa_deleted_timestamp binary(14) default '',
 251+ fa_deleted_reason text,
 252+ fa_size int unsigned default 0,
 253+ fa_width int default 0,
 254+ fa_height int default 0,
 255+ fa_metadata mediumblob,
 256+ fa_bits int default 0,
 257+ fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 258+ fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
 259+ fa_minor_mime varbinary(100) default "unknown",
 260+ fa_description tinyblob,
 261+ fa_user int unsigned default 0,
 262+ fa_user_text varchar(255) binary,
 263+ fa_timestamp binary(14) default '',
 264+ fa_deleted tinyint unsigned NOT NULL default 0
 265+) /*$wgDBTableOptions*/;
 266+CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
 267+CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key);
 268+CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
 269+CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp);
 270+CREATE TABLE /*_*/recentchanges (
 271+ rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 272+ rc_timestamp varbinary(14) NOT NULL default '',
 273+ rc_cur_time varbinary(14) NOT NULL default '',
 274+ rc_user int unsigned NOT NULL default 0,
 275+ rc_user_text varchar(255) binary NOT NULL,
 276+ rc_namespace int NOT NULL default 0,
 277+ rc_title varchar(255) binary NOT NULL default '',
 278+ rc_comment varchar(255) binary NOT NULL default '',
 279+ rc_minor tinyint unsigned NOT NULL default 0,
 280+ rc_bot tinyint unsigned NOT NULL default 0,
 281+ rc_new tinyint unsigned NOT NULL default 0,
 282+ rc_cur_id int unsigned NOT NULL default 0,
 283+ rc_this_oldid int unsigned NOT NULL default 0,
 284+ rc_last_oldid int unsigned NOT NULL default 0,
 285+ rc_type tinyint unsigned NOT NULL default 0,
 286+ rc_moved_to_ns tinyint unsigned NOT NULL default 0,
 287+ rc_moved_to_title varchar(255) binary NOT NULL default '',
 288+ rc_patrolled tinyint unsigned NOT NULL default 0,
 289+ rc_ip varbinary(40) NOT NULL default '',
 290+ rc_old_len int,
 291+ rc_new_len int,
 292+ rc_deleted tinyint unsigned NOT NULL default 0,
 293+ rc_logid int unsigned NOT NULL default 0,
 294+ rc_log_type varbinary(255) NULL default NULL,
 295+ rc_log_action varbinary(255) NULL default NULL,
 296+ rc_params blob NULL
 297+) /*$wgDBTableOptions*/;
 298+CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp);
 299+CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title);
 300+CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id);
 301+CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp);
 302+CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip);
 303+CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
 304+CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
 305+CREATE TABLE /*_*/watchlist (
 306+ wl_user int unsigned NOT NULL,
 307+ wl_namespace int NOT NULL default 0,
 308+ wl_title varchar(255) binary NOT NULL default '',
 309+ wl_notificationtimestamp varbinary(14)
 310+) /*$wgDBTableOptions*/;
 311+CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
 312+CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
 313+CREATE TABLE /*_*/math (
 314+ math_inputhash varbinary(16) NOT NULL,
 315+ math_outputhash varbinary(16) NOT NULL,
 316+ math_html_conservativeness tinyint NOT NULL,
 317+ math_html text,
 318+ math_mathml text
 319+) /*$wgDBTableOptions*/;
 320+CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math (math_inputhash);
 321+CREATE TABLE /*_*/searchindex (
 322+ si_page int unsigned NOT NULL,
 323+ si_title varchar(255) NOT NULL default '',
 324+ si_text mediumtext NOT NULL
 325+) ENGINE=MyISAM;
 326+CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page);
 327+CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title);
 328+CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text);
 329+CREATE TABLE /*_*/interwiki (
 330+ iw_prefix varchar(32) NOT NULL,
 331+ iw_url blob NOT NULL,
 332+ iw_local bool NOT NULL,
 333+ iw_trans tinyint NOT NULL default 0
 334+) /*$wgDBTableOptions*/;
 335+CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix);
 336+CREATE TABLE /*_*/querycache (
 337+ qc_type varbinary(32) NOT NULL,
 338+ qc_value int unsigned NOT NULL default 0,
 339+ qc_namespace int NOT NULL default 0,
 340+ qc_title varchar(255) binary NOT NULL default ''
 341+) /*$wgDBTableOptions*/;
 342+CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value);
 343+CREATE TABLE /*_*/objectcache (
 344+ keyname varbinary(255) NOT NULL default '' PRIMARY KEY,
 345+ value mediumblob,
 346+ exptime datetime
 347+) /*$wgDBTableOptions*/;
 348+CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime);
 349+CREATE TABLE /*_*/transcache (
 350+ tc_url varbinary(255) NOT NULL,
 351+ tc_contents text,
 352+ tc_time binary(14) NOT NULL
 353+) /*$wgDBTableOptions*/;
 354+CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url);
 355+CREATE TABLE /*_*/logging (
 356+ log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 357+ log_type varbinary(32) NOT NULL default '',
 358+ log_action varbinary(32) NOT NULL default '',
 359+ log_timestamp binary(14) NOT NULL default '19700101000000',
 360+ log_user int unsigned NOT NULL default 0,
 361+ log_user_text varchar(255) binary NOT NULL default '',
 362+ log_namespace int NOT NULL default 0,
 363+ log_title varchar(255) binary NOT NULL default '',
 364+ log_page int unsigned NULL,
 365+ log_comment varchar(255) NOT NULL default '',
 366+ log_params blob NOT NULL,
 367+ log_deleted tinyint unsigned NOT NULL default 0
 368+) /*$wgDBTableOptions*/;
 369+CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp);
 370+CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp);
 371+CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp);
 372+CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp);
 373+CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp);
 374+CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp);
 375+CREATE TABLE /*_*/log_search (
 376+ ls_field varbinary(32) NOT NULL,
 377+ ls_value varchar(255) NOT NULL,
 378+ ls_log_id int unsigned NOT NULL default 0
 379+) /*$wgDBTableOptions*/;
 380+CREATE UNIQUE INDEX /*i*/ls_field_val ON /*_*/log_search (ls_field,ls_value,ls_log_id);
 381+CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id);
 382+CREATE TABLE /*_*/trackbacks (
 383+ tb_id int PRIMARY KEY AUTO_INCREMENT,
 384+ tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE,
 385+ tb_title varchar(255) NOT NULL,
 386+ tb_url blob NOT NULL,
 387+ tb_ex text,
 388+ tb_name varchar(255)
 389+) /*$wgDBTableOptions*/;
 390+CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page);
 391+CREATE TABLE /*_*/job (
 392+ job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 393+ job_cmd varbinary(60) NOT NULL default '',
 394+ job_namespace int NOT NULL,
 395+ job_title varchar(255) binary NOT NULL,
 396+ job_params blob NOT NULL
 397+) /*$wgDBTableOptions*/;
 398+CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title, job_params(128));
 399+CREATE TABLE /*_*/querycache_info (
 400+ qci_type varbinary(32) NOT NULL default '',
 401+ qci_timestamp binary(14) NOT NULL default '19700101000000'
 402+) /*$wgDBTableOptions*/;
 403+CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type);
 404+CREATE TABLE /*_*/redirect (
 405+ rd_from int unsigned NOT NULL default 0 PRIMARY KEY,
 406+ rd_namespace int NOT NULL default 0,
 407+ rd_title varchar(255) binary NOT NULL default '',
 408+ rd_interwiki varchar(32) default NULL,
 409+ rd_fragment varchar(255) binary default NULL
 410+) /*$wgDBTableOptions*/;
 411+CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from);
 412+CREATE TABLE /*_*/querycachetwo (
 413+ qcc_type varbinary(32) NOT NULL,
 414+ qcc_value int unsigned NOT NULL default 0,
 415+ qcc_namespace int NOT NULL default 0,
 416+ qcc_title varchar(255) binary NOT NULL default '',
 417+ qcc_namespacetwo int NOT NULL default 0,
 418+ qcc_titletwo varchar(255) binary NOT NULL default ''
 419+) /*$wgDBTableOptions*/;
 420+CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value);
 421+CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title);
 422+CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo);
 423+CREATE TABLE /*_*/page_restrictions (
 424+ pr_page int NOT NULL,
 425+ pr_type varbinary(60) NOT NULL,
 426+ pr_level varbinary(60) NOT NULL,
 427+ pr_cascade tinyint NOT NULL,
 428+ pr_user int NULL,
 429+ pr_expiry varbinary(14) NULL,
 430+ pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT
 431+) /*$wgDBTableOptions*/;
 432+CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type);
 433+CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level);
 434+CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level);
 435+CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade);
 436+CREATE TABLE /*_*/protected_titles (
 437+ pt_namespace int NOT NULL,
 438+ pt_title varchar(255) binary NOT NULL,
 439+ pt_user int unsigned NOT NULL,
 440+ pt_reason tinyblob,
 441+ pt_timestamp binary(14) NOT NULL,
 442+ pt_expiry varbinary(14) NOT NULL default '',
 443+ pt_create_perm varbinary(60) NOT NULL
 444+) /*$wgDBTableOptions*/;
 445+CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title);
 446+CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp);
 447+CREATE TABLE /*_*/page_props (
 448+ pp_page int NOT NULL,
 449+ pp_propname varbinary(60) NOT NULL,
 450+ pp_value blob NOT NULL
 451+) /*$wgDBTableOptions*/;
 452+CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname);
 453+CREATE TABLE /*_*/updatelog (
 454+ ul_key varchar(255) NOT NULL PRIMARY KEY
 455+) /*$wgDBTableOptions*/;
 456+CREATE TABLE /*_*/change_tag (
 457+ ct_rc_id int NULL,
 458+ ct_log_id int NULL,
 459+ ct_rev_id int NULL,
 460+ ct_tag varchar(255) NOT NULL,
 461+ ct_params blob NULL
 462+) /*$wgDBTableOptions*/;
 463+CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag);
 464+CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag);
 465+CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag);
 466+CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id);
 467+CREATE TABLE /*_*/tag_summary (
 468+ ts_rc_id int NULL,
 469+ ts_log_id int NULL,
 470+ ts_rev_id int NULL,
 471+ ts_tags blob NOT NULL
 472+) /*$wgDBTableOptions*/;
 473+CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id);
 474+CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id);
 475+CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id);
 476+CREATE TABLE /*_*/valid_tag (
 477+ vt_tag varchar(255) NOT NULL PRIMARY KEY
 478+) /*$wgDBTableOptions*/;
 479+CREATE TABLE /*_*/l10n_cache (
 480+ lc_lang varbinary(32) NOT NULL,
 481+ lc_key varchar(255) NOT NULL,
 482+ lc_value mediumblob NOT NULL
 483+) /*$wgDBTableOptions*/;
 484+CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key);
Index: trunk/phase3/tests/phpunit/includes/db/sqlite/tables-1.17.sql
@@ -0,0 +1,516 @@
 2+-- This is a copy of MediaWiki 1.17 schema shared by MySQL and SQLite.
 3+-- It is used for updater testing. Comments are stripped to decrease
 4+-- file size, as we don't need to maintain it.
 5+
 6+CREATE TABLE /*_*/user (
 7+ user_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 8+ user_name varchar(255) binary NOT NULL default '',
 9+ user_real_name varchar(255) binary NOT NULL default '',
 10+ user_password tinyblob NOT NULL,
 11+ user_newpassword tinyblob NOT NULL,
 12+ user_newpass_time binary(14),
 13+ user_email tinytext NOT NULL,
 14+ user_options blob NOT NULL,
 15+ user_touched binary(14) NOT NULL default '',
 16+ user_token binary(32) NOT NULL default '',
 17+ user_email_authenticated binary(14),
 18+ user_email_token binary(32),
 19+ user_email_token_expires binary(14),
 20+ user_registration binary(14),
 21+ user_editcount int
 22+) /*$wgDBTableOptions*/;
 23+CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name);
 24+CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token);
 25+CREATE TABLE /*_*/user_groups (
 26+ ug_user int unsigned NOT NULL default 0,
 27+ ug_group varbinary(16) NOT NULL default ''
 28+) /*$wgDBTableOptions*/;
 29+CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group);
 30+CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
 31+CREATE TABLE /*_*/user_newtalk (
 32+ user_id int NOT NULL default 0,
 33+ user_ip varbinary(40) NOT NULL default '',
 34+ user_last_timestamp binary(14) NOT NULL default ''
 35+) /*$wgDBTableOptions*/;
 36+CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id);
 37+CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip);
 38+CREATE TABLE /*_*/user_properties (
 39+ up_user int NOT NULL,
 40+ up_property varbinary(32) NOT NULL,
 41+ up_value blob
 42+) /*$wgDBTableOptions*/;
 43+CREATE UNIQUE INDEX /*i*/user_properties_user_property ON /*_*/user_properties (up_user,up_property);
 44+CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property);
 45+CREATE TABLE /*_*/page (
 46+ page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 47+ page_namespace int NOT NULL,
 48+ page_title varchar(255) binary NOT NULL,
 49+ page_restrictions tinyblob NOT NULL,
 50+ page_counter bigint unsigned NOT NULL default 0,
 51+ page_is_redirect tinyint unsigned NOT NULL default 0,
 52+ page_is_new tinyint unsigned NOT NULL default 0,
 53+ page_random real unsigned NOT NULL,
 54+ page_touched binary(14) NOT NULL default '',
 55+ page_latest int unsigned NOT NULL,
 56+ page_len int unsigned NOT NULL
 57+) /*$wgDBTableOptions*/;
 58+CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title);
 59+CREATE INDEX /*i*/page_random ON /*_*/page (page_random);
 60+CREATE INDEX /*i*/page_len ON /*_*/page (page_len);
 61+CREATE TABLE /*_*/revision (
 62+ rev_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 63+ rev_page int unsigned NOT NULL,
 64+ rev_text_id int unsigned NOT NULL,
 65+ rev_comment tinyblob NOT NULL,
 66+ rev_user int unsigned NOT NULL default 0,
 67+ rev_user_text varchar(255) binary NOT NULL default '',
 68+ rev_timestamp binary(14) NOT NULL default '',
 69+ rev_minor_edit tinyint unsigned NOT NULL default 0,
 70+ rev_deleted tinyint unsigned NOT NULL default 0,
 71+ rev_len int unsigned,
 72+ rev_parent_id int unsigned default NULL
 73+) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
 74+CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id);
 75+CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp);
 76+CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp);
 77+CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp);
 78+CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp);
 79+CREATE TABLE /*_*/text (
 80+ old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 81+ old_text mediumblob NOT NULL,
 82+ old_flags tinyblob NOT NULL
 83+) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;
 84+CREATE TABLE /*_*/archive (
 85+ ar_namespace int NOT NULL default 0,
 86+ ar_title varchar(255) binary NOT NULL default '',
 87+ ar_text mediumblob NOT NULL,
 88+ ar_comment tinyblob NOT NULL,
 89+ ar_user int unsigned NOT NULL default 0,
 90+ ar_user_text varchar(255) binary NOT NULL,
 91+ ar_timestamp binary(14) NOT NULL default '',
 92+ ar_minor_edit tinyint NOT NULL default 0,
 93+ ar_flags tinyblob NOT NULL,
 94+ ar_rev_id int unsigned,
 95+ ar_text_id int unsigned,
 96+ ar_deleted tinyint unsigned NOT NULL default 0,
 97+ ar_len int unsigned,
 98+ ar_page_id int unsigned,
 99+ ar_parent_id int unsigned default NULL
 100+) /*$wgDBTableOptions*/;
 101+CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp);
 102+CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp);
 103+CREATE INDEX /*i*/ar_revid ON /*_*/archive (ar_rev_id);
 104+CREATE TABLE /*_*/pagelinks (
 105+ pl_from int unsigned NOT NULL default 0,
 106+ pl_namespace int NOT NULL default 0,
 107+ pl_title varchar(255) binary NOT NULL default ''
 108+) /*$wgDBTableOptions*/;
 109+CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title);
 110+CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from);
 111+CREATE TABLE /*_*/templatelinks (
 112+ tl_from int unsigned NOT NULL default 0,
 113+ tl_namespace int NOT NULL default 0,
 114+ tl_title varchar(255) binary NOT NULL default ''
 115+) /*$wgDBTableOptions*/;
 116+CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title);
 117+CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from);
 118+CREATE TABLE /*_*/imagelinks (
 119+ il_from int unsigned NOT NULL default 0,
 120+ il_to varchar(255) binary NOT NULL default ''
 121+) /*$wgDBTableOptions*/;
 122+CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to);
 123+CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from);
 124+CREATE TABLE /*_*/categorylinks (
 125+ cl_from int unsigned NOT NULL default 0,
 126+ cl_to varchar(255) binary NOT NULL default '',
 127+ cl_sortkey varbinary(230) NOT NULL default '',
 128+ cl_sortkey_prefix varchar(255) binary NOT NULL default '',
 129+ cl_timestamp timestamp NOT NULL,
 130+ cl_collation varbinary(32) NOT NULL default '',
 131+ cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page'
 132+) /*$wgDBTableOptions*/;
 133+CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to);
 134+CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_type,cl_sortkey,cl_from);
 135+CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp);
 136+CREATE INDEX /*i*/cl_collation ON /*_*/categorylinks (cl_collation);
 137+CREATE TABLE /*_*/category (
 138+ cat_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 139+ cat_title varchar(255) binary NOT NULL,
 140+ cat_pages int signed NOT NULL default 0,
 141+ cat_subcats int signed NOT NULL default 0,
 142+ cat_files int signed NOT NULL default 0,
 143+ cat_hidden tinyint unsigned NOT NULL default 0
 144+) /*$wgDBTableOptions*/;
 145+CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title);
 146+CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages);
 147+CREATE TABLE /*_*/externallinks (
 148+ el_from int unsigned NOT NULL default 0,
 149+ el_to blob NOT NULL,
 150+ el_index blob NOT NULL
 151+) /*$wgDBTableOptions*/;
 152+CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40));
 153+CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from);
 154+CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60));
 155+CREATE TABLE /*_*/external_user (
 156+ eu_local_id int unsigned NOT NULL PRIMARY KEY,
 157+ eu_external_id varchar(255) binary NOT NULL
 158+) /*$wgDBTableOptions*/;
 159+CREATE UNIQUE INDEX /*i*/eu_external_id ON /*_*/external_user (eu_external_id);
 160+CREATE TABLE /*_*/langlinks (
 161+ ll_from int unsigned NOT NULL default 0,
 162+ ll_lang varbinary(20) NOT NULL default '',
 163+ ll_title varchar(255) binary NOT NULL default ''
 164+) /*$wgDBTableOptions*/;
 165+CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang);
 166+CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title);
 167+CREATE TABLE /*_*/iwlinks (
 168+ iwl_from int unsigned NOT NULL default 0,
 169+ iwl_prefix varbinary(20) NOT NULL default '',
 170+ iwl_title varchar(255) binary NOT NULL default ''
 171+) /*$wgDBTableOptions*/;
 172+CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title);
 173+CREATE UNIQUE INDEX /*i*/iwl_prefix_title_from ON /*_*/iwlinks (iwl_prefix, iwl_title, iwl_from);
 174+CREATE TABLE /*_*/site_stats (
 175+ ss_row_id int unsigned NOT NULL,
 176+ ss_total_views bigint unsigned default 0,
 177+ ss_total_edits bigint unsigned default 0,
 178+ ss_good_articles bigint unsigned default 0,
 179+ ss_total_pages bigint default '-1',
 180+ ss_users bigint default '-1',
 181+ ss_active_users bigint default '-1',
 182+ ss_admins int default '-1',
 183+ ss_images int default 0
 184+) /*$wgDBTableOptions*/;
 185+CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
 186+CREATE TABLE /*_*/hitcounter (
 187+ hc_id int unsigned NOT NULL
 188+) ENGINE=HEAP MAX_ROWS=25000;
 189+CREATE TABLE /*_*/ipblocks (
 190+ ipb_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 191+ ipb_address tinyblob NOT NULL,
 192+ ipb_user int unsigned NOT NULL default 0,
 193+ ipb_by int unsigned NOT NULL default 0,
 194+ ipb_by_text varchar(255) binary NOT NULL default '',
 195+ ipb_reason tinyblob NOT NULL,
 196+ ipb_timestamp binary(14) NOT NULL default '',
 197+ ipb_auto bool NOT NULL default 0,
 198+ ipb_anon_only bool NOT NULL default 0,
 199+ ipb_create_account bool NOT NULL default 1,
 200+ ipb_enable_autoblock bool NOT NULL default '1',
 201+ ipb_expiry varbinary(14) NOT NULL default '',
 202+ ipb_range_start tinyblob NOT NULL,
 203+ ipb_range_end tinyblob NOT NULL,
 204+ ipb_deleted bool NOT NULL default 0,
 205+ ipb_block_email bool NOT NULL default 0,
 206+ ipb_allow_usertalk bool NOT NULL default 0
 207+) /*$wgDBTableOptions*/;
 208+CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
 209+CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user);
 210+CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8));
 211+CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp);
 212+CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry);
 213+CREATE TABLE /*_*/image (
 214+ img_name varchar(255) binary NOT NULL default '' PRIMARY KEY,
 215+ img_size int unsigned NOT NULL default 0,
 216+ img_width int NOT NULL default 0,
 217+ img_height int NOT NULL default 0,
 218+ img_metadata mediumblob NOT NULL,
 219+ img_bits int NOT NULL default 0,
 220+ img_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 221+ img_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
 222+ img_minor_mime varbinary(100) NOT NULL default "unknown",
 223+ img_description tinyblob NOT NULL,
 224+ img_user int unsigned NOT NULL default 0,
 225+ img_user_text varchar(255) binary NOT NULL,
 226+ img_timestamp varbinary(14) NOT NULL default '',
 227+ img_sha1 varbinary(32) NOT NULL default ''
 228+) /*$wgDBTableOptions*/;
 229+CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp);
 230+CREATE INDEX /*i*/img_size ON /*_*/image (img_size);
 231+CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp);
 232+CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1);
 233+CREATE TABLE /*_*/oldimage (
 234+ oi_name varchar(255) binary NOT NULL default '',
 235+ oi_archive_name varchar(255) binary NOT NULL default '',
 236+ oi_size int unsigned NOT NULL default 0,
 237+ oi_width int NOT NULL default 0,
 238+ oi_height int NOT NULL default 0,
 239+ oi_bits int NOT NULL default 0,
 240+ oi_description tinyblob NOT NULL,
 241+ oi_user int unsigned NOT NULL default 0,
 242+ oi_user_text varchar(255) binary NOT NULL,
 243+ oi_timestamp binary(14) NOT NULL default '',
 244+ oi_metadata mediumblob NOT NULL,
 245+ oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 246+ oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
 247+ oi_minor_mime varbinary(100) NOT NULL default "unknown",
 248+ oi_deleted tinyint unsigned NOT NULL default 0,
 249+ oi_sha1 varbinary(32) NOT NULL default ''
 250+) /*$wgDBTableOptions*/;
 251+CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp);
 252+CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp);
 253+CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14));
 254+CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1);
 255+CREATE TABLE /*_*/filearchive (
 256+ fa_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 257+ fa_name varchar(255) binary NOT NULL default '',
 258+ fa_archive_name varchar(255) binary default '',
 259+ fa_storage_group varbinary(16),
 260+ fa_storage_key varbinary(64) default '',
 261+ fa_deleted_user int,
 262+ fa_deleted_timestamp binary(14) default '',
 263+ fa_deleted_reason text,
 264+ fa_size int unsigned default 0,
 265+ fa_width int default 0,
 266+ fa_height int default 0,
 267+ fa_metadata mediumblob,
 268+ fa_bits int default 0,
 269+ fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
 270+ fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown",
 271+ fa_minor_mime varbinary(100) default "unknown",
 272+ fa_description tinyblob,
 273+ fa_user int unsigned default 0,
 274+ fa_user_text varchar(255) binary,
 275+ fa_timestamp binary(14) default '',
 276+ fa_deleted tinyint unsigned NOT NULL default 0
 277+) /*$wgDBTableOptions*/;
 278+CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
 279+CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key);
 280+CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
 281+CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp);
 282+CREATE TABLE /*_*/recentchanges (
 283+ rc_id int NOT NULL PRIMARY KEY AUTO_INCREMENT,
 284+ rc_timestamp varbinary(14) NOT NULL default '',
 285+ rc_cur_time varbinary(14) NOT NULL default '',
 286+ rc_user int unsigned NOT NULL default 0,
 287+ rc_user_text varchar(255) binary NOT NULL,
 288+ rc_namespace int NOT NULL default 0,
 289+ rc_title varchar(255) binary NOT NULL default '',
 290+ rc_comment varchar(255) binary NOT NULL default '',
 291+ rc_minor tinyint unsigned NOT NULL default 0,
 292+ rc_bot tinyint unsigned NOT NULL default 0,
 293+ rc_new tinyint unsigned NOT NULL default 0,
 294+ rc_cur_id int unsigned NOT NULL default 0,
 295+ rc_this_oldid int unsigned NOT NULL default 0,
 296+ rc_last_oldid int unsigned NOT NULL default 0,
 297+ rc_type tinyint unsigned NOT NULL default 0,
 298+ rc_moved_to_ns tinyint unsigned NOT NULL default 0,
 299+ rc_moved_to_title varchar(255) binary NOT NULL default '',
 300+ rc_patrolled tinyint unsigned NOT NULL default 0,
 301+ rc_ip varbinary(40) NOT NULL default '',
 302+ rc_old_len int,
 303+ rc_new_len int,
 304+ rc_deleted tinyint unsigned NOT NULL default 0,
 305+ rc_logid int unsigned NOT NULL default 0,
 306+ rc_log_type varbinary(255) NULL default NULL,
 307+ rc_log_action varbinary(255) NULL default NULL,
 308+ rc_params blob NULL
 309+) /*$wgDBTableOptions*/;
 310+CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp);
 311+CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title);
 312+CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id);
 313+CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp);
 314+CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip);
 315+CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
 316+CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
 317+CREATE TABLE /*_*/watchlist (
 318+ wl_user int unsigned NOT NULL,
 319+ wl_namespace int NOT NULL default 0,
 320+ wl_title varchar(255) binary NOT NULL default '',
 321+ wl_notificationtimestamp varbinary(14)
 322+) /*$wgDBTableOptions*/;
 323+CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
 324+CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
 325+CREATE TABLE /*_*/math (
 326+ math_inputhash varbinary(16) NOT NULL,
 327+ math_outputhash varbinary(16) NOT NULL,
 328+ math_html_conservativeness tinyint NOT NULL,
 329+ math_html text,
 330+ math_mathml text
 331+) /*$wgDBTableOptions*/;
 332+CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math (math_inputhash);
 333+CREATE TABLE /*_*/searchindex (
 334+ si_page int unsigned NOT NULL,
 335+ si_title varchar(255) NOT NULL default '',
 336+ si_text mediumtext NOT NULL
 337+) ENGINE=MyISAM;
 338+CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page);
 339+CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title);
 340+CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text);
 341+CREATE TABLE /*_*/interwiki (
 342+ iw_prefix varchar(32) NOT NULL,
 343+ iw_url blob NOT NULL,
 344+ iw_api blob NOT NULL,
 345+ iw_wikiid varchar(64) NOT NULL,
 346+ iw_local bool NOT NULL,
 347+ iw_trans tinyint NOT NULL default 0
 348+) /*$wgDBTableOptions*/;
 349+CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix);
 350+CREATE TABLE /*_*/querycache (
 351+ qc_type varbinary(32) NOT NULL,
 352+ qc_value int unsigned NOT NULL default 0,
 353+ qc_namespace int NOT NULL default 0,
 354+ qc_title varchar(255) binary NOT NULL default ''
 355+) /*$wgDBTableOptions*/;
 356+CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value);
 357+CREATE TABLE /*_*/objectcache (
 358+ keyname varbinary(255) NOT NULL default '' PRIMARY KEY,
 359+ value mediumblob,
 360+ exptime datetime
 361+) /*$wgDBTableOptions*/;
 362+CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime);
 363+CREATE TABLE /*_*/transcache (
 364+ tc_url varbinary(255) NOT NULL,
 365+ tc_contents text,
 366+ tc_time binary(14) NOT NULL
 367+) /*$wgDBTableOptions*/;
 368+CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url);
 369+CREATE TABLE /*_*/logging (
 370+ log_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 371+ log_type varbinary(32) NOT NULL default '',
 372+ log_action varbinary(32) NOT NULL default '',
 373+ log_timestamp binary(14) NOT NULL default '19700101000000',
 374+ log_user int unsigned NOT NULL default 0,
 375+ log_user_text varchar(255) binary NOT NULL default '',
 376+ log_namespace int NOT NULL default 0,
 377+ log_title varchar(255) binary NOT NULL default '',
 378+ log_page int unsigned NULL,
 379+ log_comment varchar(255) NOT NULL default '',
 380+ log_params blob NOT NULL,
 381+ log_deleted tinyint unsigned NOT NULL default 0
 382+) /*$wgDBTableOptions*/;
 383+CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp);
 384+CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp);
 385+CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp);
 386+CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp);
 387+CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp);
 388+CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp);
 389+CREATE TABLE /*_*/log_search (
 390+ ls_field varbinary(32) NOT NULL,
 391+ ls_value varchar(255) NOT NULL,
 392+ ls_log_id int unsigned NOT NULL default 0
 393+) /*$wgDBTableOptions*/;
 394+CREATE UNIQUE INDEX /*i*/ls_field_val ON /*_*/log_search (ls_field,ls_value,ls_log_id);
 395+CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id);
 396+CREATE TABLE /*_*/trackbacks (
 397+ tb_id int PRIMARY KEY AUTO_INCREMENT,
 398+ tb_page int REFERENCES /*_*/page(page_id) ON DELETE CASCADE,
 399+ tb_title varchar(255) NOT NULL,
 400+ tb_url blob NOT NULL,
 401+ tb_ex text,
 402+ tb_name varchar(255)
 403+) /*$wgDBTableOptions*/;
 404+CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page);
 405+CREATE TABLE /*_*/job (
 406+ job_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
 407+ job_cmd varbinary(60) NOT NULL default '',
 408+ job_namespace int NOT NULL,
 409+ job_title varchar(255) binary NOT NULL,
 410+ job_params blob NOT NULL
 411+) /*$wgDBTableOptions*/;
 412+CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title, job_params(128));
 413+CREATE TABLE /*_*/querycache_info (
 414+ qci_type varbinary(32) NOT NULL default '',
 415+ qci_timestamp binary(14) NOT NULL default '19700101000000'
 416+) /*$wgDBTableOptions*/;
 417+CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type);
 418+CREATE TABLE /*_*/redirect (
 419+ rd_from int unsigned NOT NULL default 0 PRIMARY KEY,
 420+ rd_namespace int NOT NULL default 0,
 421+ rd_title varchar(255) binary NOT NULL default '',
 422+ rd_interwiki varchar(32) default NULL,
 423+ rd_fragment varchar(255) binary default NULL
 424+) /*$wgDBTableOptions*/;
 425+CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from);
 426+CREATE TABLE /*_*/querycachetwo (
 427+ qcc_type varbinary(32) NOT NULL,
 428+ qcc_value int unsigned NOT NULL default 0,
 429+ qcc_namespace int NOT NULL default 0,
 430+ qcc_title varchar(255) binary NOT NULL default '',
 431+ qcc_namespacetwo int NOT NULL default 0,
 432+ qcc_titletwo varchar(255) binary NOT NULL default ''
 433+) /*$wgDBTableOptions*/;
 434+CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value);
 435+CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title);
 436+CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo);
 437+CREATE TABLE /*_*/page_restrictions (
 438+ pr_page int NOT NULL,
 439+ pr_type varbinary(60) NOT NULL,
 440+ pr_level varbinary(60) NOT NULL,
 441+ pr_cascade tinyint NOT NULL,
 442+ pr_user int NULL,
 443+ pr_expiry varbinary(14) NULL,
 444+ pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT
 445+) /*$wgDBTableOptions*/;
 446+CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type);
 447+CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level);
 448+CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level);
 449+CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade);
 450+CREATE TABLE /*_*/protected_titles (
 451+ pt_namespace int NOT NULL,
 452+ pt_title varchar(255) binary NOT NULL,
 453+ pt_user int unsigned NOT NULL,
 454+ pt_reason tinyblob,
 455+ pt_timestamp binary(14) NOT NULL,
 456+ pt_expiry varbinary(14) NOT NULL default '',
 457+ pt_create_perm varbinary(60) NOT NULL
 458+) /*$wgDBTableOptions*/;
 459+CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title);
 460+CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp);
 461+CREATE TABLE /*_*/page_props (
 462+ pp_page int NOT NULL,
 463+ pp_propname varbinary(60) NOT NULL,
 464+ pp_value blob NOT NULL
 465+) /*$wgDBTableOptions*/;
 466+CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname);
 467+CREATE TABLE /*_*/updatelog (
 468+ ul_key varchar(255) NOT NULL PRIMARY KEY,
 469+ ul_value blob
 470+) /*$wgDBTableOptions*/;
 471+CREATE TABLE /*_*/change_tag (
 472+ ct_rc_id int NULL,
 473+ ct_log_id int NULL,
 474+ ct_rev_id int NULL,
 475+ ct_tag varchar(255) NOT NULL,
 476+ ct_params blob NULL
 477+) /*$wgDBTableOptions*/;
 478+CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag);
 479+CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag);
 480+CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag);
 481+CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id);
 482+CREATE TABLE /*_*/tag_summary (
 483+ ts_rc_id int NULL,
 484+ ts_log_id int NULL,
 485+ ts_rev_id int NULL,
 486+ ts_tags blob NOT NULL
 487+) /*$wgDBTableOptions*/;
 488+CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id);
 489+CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id);
 490+CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id);
 491+CREATE TABLE /*_*/valid_tag (
 492+ vt_tag varchar(255) NOT NULL PRIMARY KEY
 493+) /*$wgDBTableOptions*/;
 494+CREATE TABLE /*_*/l10n_cache (
 495+ lc_lang varbinary(32) NOT NULL,
 496+ lc_key varchar(255) NOT NULL,
 497+ lc_value mediumblob NOT NULL
 498+) /*$wgDBTableOptions*/;
 499+CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key);
 500+CREATE TABLE /*_*/msg_resource (
 501+ mr_resource varbinary(255) NOT NULL,
 502+ mr_lang varbinary(32) NOT NULL,
 503+ mr_blob mediumblob NOT NULL,
 504+ mr_timestamp binary(14) NOT NULL
 505+) /*$wgDBTableOptions*/;
 506+CREATE UNIQUE INDEX /*i*/mr_resource_lang ON /*_*/msg_resource (mr_resource, mr_lang);
 507+CREATE TABLE /*_*/msg_resource_links (
 508+ mrl_resource varbinary(255) NOT NULL,
 509+ mrl_message varbinary(255) NOT NULL
 510+) /*$wgDBTableOptions*/;
 511+CREATE UNIQUE INDEX /*i*/mrl_message_resource ON /*_*/msg_resource_links (mrl_message, mrl_resource);
 512+CREATE TABLE /*_*/module_deps (
 513+ md_module varbinary(255) NOT NULL,
 514+ md_skin varbinary(32) NOT NULL,
 515+ md_deps mediumblob NOT NULL
 516+) /*$wgDBTableOptions*/;
 517+CREATE UNIQUE INDEX /*i*/md_module_skin ON /*_*/module_deps (md_module, md_skin);
Index: trunk/phase3/tests/phpunit/includes/db/DatabaseSqliteTest.php
@@ -28,6 +28,9 @@
2929 $this->markTestSkipped( 'No SQLite support detected' );
3030 }
3131 $this->db = new MockDatabaseSqlite();
 32+ if ( version_compare( $this->db->getServerVersion(), '3.6.0', '<' ) ) {
 33+ $this->markTestSkipped( "SQLite at least 3.6 required, {$this->db->getServerVersion()} found" );
 34+ }
3235 }
3336
3437 private function replaceVars( $sql ) {
@@ -124,7 +127,7 @@
125128 );
126129 }
127130
128 - function testEntireSchema() {
 131+ public function testEntireSchema() {
129132 global $IP;
130133
131134 $result = Sqlite::checkSqlSyntax( "$IP/maintenance/tables.sql" );
@@ -132,4 +135,59 @@
133136 $this->fail( $result );
134137 }
135138 }
 139+
 140+ /**
 141+ * Runs upgrades of older databases and compares results with current schema
 142+ * @todo: currently only checks list of tables
 143+ */
 144+ public function testUpgrades() {
 145+ global $IP;
 146+
 147+ $versions = array( '1.13', '1.15', '1.16', '1.17' ); // SQLite wasn't included in 1.14
 148+ $currentDB = new DatabaseSqliteStandalone( ':memory:' );
 149+ $currentDB->sourceFile( "$IP/maintenance/tables.sql" );
 150+ $currentTables = $this->getTables( $currentDB );
 151+ sort( $currentTables );
 152+
 153+ foreach ( $versions as $version ) {
 154+ $db = $this->prepareDB( $version );
 155+ $tables = $this->getTables( $db );
 156+ $this->assertEquals( $currentTables, $tables );
 157+ $db->close();
 158+ }
 159+ }
 160+
 161+ private function prepareDB( $version ) {
 162+ static $maint = null;
 163+ if ( $maint === null ) {
 164+ $maint = new FakeMaintenance();
 165+ $maint->loadParamsAndArgs( null, array( 'quiet' => 1 ) );
 166+ }
 167+
 168+ $db = new DatabaseSqliteStandalone( ':memory:' );
 169+ $db->sourceFile( dirname( __FILE__ ) . "/sqlite/tables-$version.sql" );
 170+ $updater = DatabaseUpdater::newForDB( $db, false, $maint );
 171+ $updater->doUpdates( array( 'core' ) );
 172+ return $db;
 173+ }
 174+
 175+ protected function getTables( $db ) {
 176+ $list = array_flip( $db->listTables() );
 177+ $excluded = array(
 178+ 'math', // moved out of core in 1.18
 179+ 'searchindex',
 180+ 'searchindex_content',
 181+ 'searchindex_segments',
 182+ 'searchindex_segdir',
 183+ // FTS4 ready!!1
 184+ 'searchindex_docsize',
 185+ 'searchindex_stat',
 186+ );
 187+ foreach ( $excluded as $t ) {
 188+ unset( $list[$t] );
 189+ }
 190+ $list = array_flip( $list );
 191+ sort( $list );
 192+ return $list;
 193+ }
136194 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r96174Fix r87731: update site stats only when explicitly asked to do somaxsem10:23, 3 September 2011

Comments

#Comment by Platonides (talk | contribs)   15:17, 21 June 2011

DatabaseSqliteTest::testUpgrades is trying to connect to the real db as of r90527.

phase3/includes/db/Database.php:676
phase3/includes/db/DatabaseMysql.php:131
phase3/includes/db/Database.php:575
phase3/includes/db/Database.php:625
phase3/includes/db/LoadBalancer.php:672
phase3/includes/db/LoadBalancer.php:550
phase3/includes/db/LoadBalancer.php:471
phase3/includes/GlobalFunctions.php:3112
phase3/includes/SiteStats.php:323
phase3/includes/SiteStats.php:411
phase3/includes/installer/DatabaseUpdater.php:496
phase3/includes/installer/DatabaseUpdater.php:209
phase3/tests/phpunit/includes/db/DatabaseSqliteTest.php:261
phase3/tests/phpunit/includes/db/DatabaseSqliteTest.php:208
phase3/tests/phpunit/MediaWikiTestCase.php:64
phase3/tests/phpunit/MediaWikiPHPUnitCommand.php:20
phase3/tests/phpunit/phpunit.php:60
#Comment by Reedy (talk | contribs)   21:24, 24 August 2011

Wrong revision number

#Comment by MaxSem (talk | contribs)   10:27, 3 September 2011

Done in r96174.

#Comment by Catrope (talk | contribs)   19:52, 5 September 2011

??? I think that rev has the wrong followup number.

#Comment by Catrope (talk | contribs)   19:54, 5 September 2011

...or not, I see how they could be related. Setting to resolved per Chad's review on June 16th.

Status & tagging log