-- Newline-separated list of name=value defining the user
-- preferences
+ -- Now obsolete in favour of user_properties table;
+ -- old values will be migrated from here transparently.
user_options blob NOT NULL,
-- This is a timestamp which is updated when a user
user_editcount int
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX user_name ON /*_*/user (user_name);
-CREATE INDEX user_email_token ON /*_*/user (user_email_token);
+CREATE UNIQUE INDEX /*i*/user_name ON /*_*/user (user_name);
+CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token);
--
ug_group varbinary(16) NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX ug_user_group ON /*_*/user_groups (ug_user,ug_group);
-CREATE INDEX ug_group ON /*_*/user_groups (ug_group);
+CREATE UNIQUE INDEX /*i*/ug_user_group ON /*_*/user_groups (ug_user,ug_group);
+CREATE INDEX /*i*/ug_group ON /*_*/user_groups (ug_group);
+--
-- Stores notifications of user talk page changes, for the display
-- of the "you have new messages" box
+--
CREATE TABLE /*_*/user_newtalk (
-- Key to user.user_id
user_id int NOT NULL default 0,
) /*$wgDBTableOptions*/;
-- Indexes renamed for SQLite in 1.14
-CREATE INDEX un_user_id ON /*_*/user_newtalk (user_id);
-CREATE INDEX un_user_ip ON /*_*/user_newtalk (user_ip);
+CREATE INDEX /*i*/un_user_id ON /*_*/user_newtalk (user_id);
+CREATE INDEX /*i*/un_user_ip ON /*_*/user_newtalk (user_ip);
+--
+-- User preferences and perhaps other fun stuff. :)
+-- Replaces the old user.user_options blob, with a couple nice properties:
+--
+-- 1) We only store non-default settings, so changes to the defauls
+-- are now reflected for everybody, not just new accounts.
+-- 2) We can more easily do bulk lookups, statistics, or modifications of
+-- saved options since it's a sane table structure.
+--
+CREATE TABLE /*_*/user_properties (
+ -- Foreign key to user.user_id
+ up_user int NOT NULL,
+
+ -- Name of the option being saved. This is indexed for bulk lookup.
+ up_property varbinary(32) NOT NULL,
+
+ -- Property value as a string.
+ up_value blob
+) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/user_properties_user_property ON /*_*/user_properties (up_user,up_property);
+CREATE INDEX /*i*/user_properties_property ON /*_*/user_properties (up_property);
+
--
-- Core of the wiki: each page has an entry here which identifies
-- it by title and contains some essential metadata.
page_len int unsigned NOT NULL
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX name_title ON /*_*/page (page_namespace,page_title);
-CREATE INDEX page_random ON /*_*/page (page_random);
-CREATE INDEX page_len ON /*_*/page (page_len);
+CREATE UNIQUE INDEX /*i*/name_title ON /*_*/page (page_namespace,page_title);
+CREATE INDEX /*i*/page_random ON /*_*/page (page_random);
+CREATE INDEX /*i*/page_len ON /*_*/page (page_len);
--
) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
-- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit
-CREATE UNIQUE INDEX rev_page_id ON /*_*/revision (rev_page, rev_id);
-CREATE INDEX rev_timestamp ON /*_*/revision (rev_timestamp);
-CREATE INDEX page_timestamp ON /*_*/revision (rev_page,rev_timestamp);
-CREATE INDEX user_timestamp ON /*_*/revision (rev_user,rev_timestamp);
-CREATE INDEX usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp);
+CREATE UNIQUE INDEX /*i*/rev_page_id ON /*_*/revision (rev_page, rev_id);
+CREATE INDEX /*i*/rev_timestamp ON /*_*/revision (rev_timestamp);
+CREATE INDEX /*i*/page_timestamp ON /*_*/revision (rev_page,rev_timestamp);
+CREATE INDEX /*i*/user_timestamp ON /*_*/revision (rev_user,rev_timestamp);
+CREATE INDEX /*i*/usertext_timestamp ON /*_*/revision (rev_user_text,rev_timestamp);
--
-- Holds text of individual page revisions.
ar_parent_id int unsigned default NULL
) /*$wgDBTableOptions*/;
-CREATE INDEX name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp);
-CREATE INDEX ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp);
+CREATE INDEX /*i*/name_title_timestamp ON /*_*/archive (ar_namespace,ar_title,ar_timestamp);
+CREATE INDEX /*i*/ar_usertext_timestamp ON /*_*/archive (ar_user_text,ar_timestamp);
--
pl_title varchar(255) binary NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title);
-CREATE UNIQUE INDEX pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from);
+CREATE UNIQUE INDEX /*i*/pl_from ON /*_*/pagelinks (pl_from,pl_namespace,pl_title);
+CREATE UNIQUE INDEX /*i*/pl_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from);
--
tl_title varchar(255) binary NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title);
-CREATE UNIQUE INDEX tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from);
+CREATE UNIQUE INDEX /*i*/tl_from ON /*_*/templatelinks (tl_from,tl_namespace,tl_title);
+CREATE UNIQUE INDEX /*i*/tl_namespace ON /*_*/templatelinks (tl_namespace,tl_title,tl_from);
--
il_to varchar(255) binary NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX il_from ON /*_*/imagelinks (il_from,il_to);
-CREATE UNIQUE INDEX il_to ON /*_*/imagelinks (il_to,il_from);
+CREATE UNIQUE INDEX /*i*/il_from ON /*_*/imagelinks (il_from,il_to);
+CREATE UNIQUE INDEX /*i*/il_to ON /*_*/imagelinks (il_to,il_from);
--
cl_timestamp timestamp NOT NULL
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX cl_from ON /*_*/categorylinks (cl_from,cl_to);
+CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to);
-- We always sort within a given category...
-CREATE INDEX cl_sortkey ON /*_*/categorylinks (cl_to,cl_sortkey,cl_from);
+CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_sortkey,cl_from);
-- Not really used?
-CREATE INDEX cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp);
+CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp);
--
cat_hidden tinyint unsigned NOT NULL default 0
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX cat_title ON /*_*/category (cat_title);
+CREATE UNIQUE INDEX /*i*/cat_title ON /*_*/category (cat_title);
-- For Special:Mostlinkedcategories
-CREATE INDEX cat_pages ON /*_*/category (cat_pages);
+CREATE INDEX /*i*/cat_pages ON /*_*/category (cat_pages);
--
el_index blob NOT NULL
) /*$wgDBTableOptions*/;
-CREATE INDEX el_from ON /*_*/externallinks (el_from, el_to(40));
-CREATE INDEX el_to ON /*_*/externallinks (el_to(60), el_from);
-CREATE INDEX el_index ON /*_*/externallinks (el_index(60));
+CREATE INDEX /*i*/el_from ON /*_*/externallinks (el_from, el_to(40));
+CREATE INDEX /*i*/el_to ON /*_*/externallinks (el_to(60), el_from);
+CREATE INDEX /*i*/el_index ON /*_*/externallinks (el_index(60));
+
+
+--
+-- Track external user accounts, if ExternalAuth is used
+--
+CREATE TABLE /*_*/external_user (
+ -- Foreign key to user_id
+ eu_local_id int unsigned NOT NULL PRIMARY KEY,
+
+ -- Some opaque identifier provided by the external database
+ eu_external_id varchar(255) binary NOT NULL
+) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/eu_external_id ON /*_*/external_user (eu_external_id);
--
ll_title varchar(255) binary NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX ll_from ON /*_*/langlinks (ll_from, ll_lang);
-CREATE INDEX ll_lang_title ON /*_*/langlinks (ll_lang, ll_title);
+CREATE UNIQUE INDEX /*i*/ll_from ON /*_*/langlinks (ll_from, ll_lang);
+CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title);
--
) /*$wgDBTableOptions*/;
-- Pointless index to assuage developer superstitions
-CREATE UNIQUE INDEX ss_row_id ON /*_*/site_stats (ss_row_id);
+CREATE UNIQUE INDEX /*i*/ss_row_id ON /*_*/site_stats (ss_row_id);
--
-- Stores an ID for every time any article is visited;
-- depending on $wgHitcounterUpdateFreq, it is
-- periodically cleared and the page_counter column
--- in the page table updated for the all articles
+-- in the page table updated for all the articles
-- that have been visited.)
--
CREATE TABLE /*_*/hitcounter (
-- Unique index to support "user already blocked" messages
-- Any new options which prevent collisions should be included
-CREATE UNIQUE INDEX ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
+CREATE UNIQUE INDEX /*i*/ipb_address ON /*_*/ipblocks (ipb_address(255), ipb_user, ipb_auto, ipb_anon_only);
-CREATE INDEX ipb_user ON /*_*/ipblocks (ipb_user);
-CREATE INDEX ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8));
-CREATE INDEX ipb_timestamp ON /*_*/ipblocks (ipb_timestamp);
-CREATE INDEX ipb_expiry ON /*_*/ipblocks (ipb_expiry);
+CREATE INDEX /*i*/ipb_user ON /*_*/ipblocks (ipb_user);
+CREATE INDEX /*i*/ipb_range ON /*_*/ipblocks (ipb_range_start(8), ipb_range_end(8));
+CREATE INDEX /*i*/ipb_timestamp ON /*_*/ipblocks (ipb_timestamp);
+CREATE INDEX /*i*/ipb_expiry ON /*_*/ipblocks (ipb_expiry);
--
-- Filename.
-- This is also the title of the associated description page,
-- which will be in namespace 6 (NS_FILE).
- img_name varchar(255) binary NOT NULL default '' primary key,
+ img_name varchar(255) binary NOT NULL default '' PRIMARY KEY,
-- File size in bytes.
img_size int unsigned NOT NULL default 0,
img_sha1 varbinary(32) NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE INDEX img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp);
+CREATE INDEX /*i*/img_usertext_timestamp ON /*_*/image (img_user_text,img_timestamp);
-- Used by Special:Imagelist for sort-by-size
-CREATE INDEX img_size ON /*_*/image (img_size);
+CREATE INDEX /*i*/img_size ON /*_*/image (img_size);
-- Used by Special:Newimages and Special:Imagelist
-CREATE INDEX img_timestamp ON /*_*/image (img_timestamp);
+CREATE INDEX /*i*/img_timestamp ON /*_*/image (img_timestamp);
-- Used in API and duplicate search
-CREATE INDEX img_sha1 ON /*_*/image (img_sha1);
+CREATE INDEX /*i*/img_sha1 ON /*_*/image (img_sha1);
--
oi_sha1 varbinary(32) NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE INDEX oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp);
-CREATE INDEX oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp);
+CREATE INDEX /*i*/oi_usertext_timestamp ON /*_*/oldimage (oi_user_text,oi_timestamp);
+CREATE INDEX /*i*/oi_name_timestamp ON /*_*/oldimage (oi_name,oi_timestamp);
-- oi_archive_name truncated to 14 to avoid key length overflow
-CREATE INDEX oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14));
-CREATE INDEX oi_sha1 ON /*_*/oldimage (oi_sha1);
+CREATE INDEX /*i*/oi_name_archive_name ON /*_*/oldimage (oi_name,oi_archive_name(14));
+CREATE INDEX /*i*/oi_sha1 ON /*_*/oldimage (oi_sha1);
--
) /*$wgDBTableOptions*/;
-- pick out by image name
-CREATE INDEX fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
+CREATE INDEX /*i*/fa_name ON /*_*/filearchive (fa_name, fa_timestamp);
-- pick out dupe files
-CREATE INDEX fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key);
+CREATE INDEX /*i*/fa_storage_group ON /*_*/filearchive (fa_storage_group, fa_storage_key);
-- sort by deletion time
-CREATE INDEX fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
+CREATE INDEX /*i*/fa_deleted_timestamp ON /*_*/filearchive (fa_deleted_timestamp);
-- sort by uploader
-CREATE INDEX fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp);
+CREATE INDEX /*i*/fa_user_timestamp ON /*_*/filearchive (fa_user_text,fa_timestamp);
--
rc_params blob NULL
) /*$wgDBTableOptions*/;
-CREATE INDEX rc_timestamp ON /*_*/recentchanges (rc_timestamp);
-CREATE INDEX rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title);
-CREATE INDEX rc_cur_id ON /*_*/recentchanges (rc_cur_id);
-CREATE INDEX new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp);
-CREATE INDEX rc_ip ON /*_*/recentchanges (rc_ip);
-CREATE INDEX rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
-CREATE INDEX rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
+CREATE INDEX /*i*/rc_timestamp ON /*_*/recentchanges (rc_timestamp);
+CREATE INDEX /*i*/rc_namespace_title ON /*_*/recentchanges (rc_namespace, rc_title);
+CREATE INDEX /*i*/rc_cur_id ON /*_*/recentchanges (rc_cur_id);
+CREATE INDEX /*i*/new_name_timestamp ON /*_*/recentchanges (rc_new,rc_namespace,rc_timestamp);
+CREATE INDEX /*i*/rc_ip ON /*_*/recentchanges (rc_ip);
+CREATE INDEX /*i*/rc_ns_usertext ON /*_*/recentchanges (rc_namespace, rc_user_text);
+CREATE INDEX /*i*/rc_user_text ON /*_*/recentchanges (rc_user_text, rc_timestamp);
CREATE TABLE /*_*/watchlist (
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
-CREATE INDEX namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
+CREATE UNIQUE INDEX /*i*/wl_user ON /*_*/watchlist (wl_user, wl_namespace, wl_title);
+CREATE INDEX /*i*/namespace_title ON /*_*/watchlist (wl_namespace, wl_title);
--
math_html text,
-- MathML output from texvc, if any
- math_mathml text
+ math_mathml text
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX math_inputhash ON /*_*/math (math_inputhash);
+CREATE UNIQUE INDEX /*i*/math_inputhash ON /*_*/math (math_inputhash);
--
si_text mediumtext NOT NULL
) ENGINE=MyISAM;
-CREATE UNIQUE INDEX si_page ON /*_*/searchindex (si_page);
-CREATE FULLTEXT INDEX si_title ON /*_*/searchindex (si_title);
-CREATE FULLTEXT INDEX si_text ON /*_*/searchindex (si_text);
+CREATE UNIQUE INDEX /*i*/si_page ON /*_*/searchindex (si_page);
+CREATE FULLTEXT INDEX /*i*/si_title ON /*_*/searchindex (si_title);
+CREATE FULLTEXT INDEX /*i*/si_text ON /*_*/searchindex (si_text);
--
iw_trans tinyint NOT NULL default 0
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX iw_prefix ON /*_*/interwiki (iw_prefix);
+CREATE UNIQUE INDEX /*i*/iw_prefix ON /*_*/interwiki (iw_prefix);
--
qc_title varchar(255) binary NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE INDEX qc_type ON /*_*/querycache (qc_type,qc_value);
+CREATE INDEX /*i*/qc_type ON /*_*/querycache (qc_type,qc_value);
--
-- For a few generic cache operations if not using Memcached
--
CREATE TABLE /*_*/objectcache (
- keyname varbinary(255) NOT NULL default '' primary key,
+ keyname varbinary(255) NOT NULL default '' PRIMARY KEY,
value mediumblob,
exptime datetime
) /*$wgDBTableOptions*/;
-CREATE INDEX exptime ON /*_*/objectcache (exptime);
+CREATE INDEX /*i*/exptime ON /*_*/objectcache (exptime);
--
CREATE TABLE /*_*/transcache (
tc_url varbinary(255) NOT NULL,
tc_contents text,
- tc_time int NOT NULL
+ tc_time binary(14) NOT NULL
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX tc_url_idx ON /*_*/transcache (tc_url);
+CREATE UNIQUE INDEX /*i*/tc_url_idx ON /*_*/transcache (tc_url);
CREATE TABLE /*_*/logging (
-- Symbolic keys for the general log type and the action type
-- within the log. The output format will be controlled by the
-- action field, but only the type controls categorization.
- log_type varbinary(10) NOT NULL default '',
- log_action varbinary(10) NOT NULL default '',
+ log_type varbinary(32) NOT NULL default '',
+ log_action varbinary(32) NOT NULL default '',
-- Timestamp. Duh.
log_timestamp binary(14) NOT NULL default '19700101000000',
-- The user who performed this action; key to user_id
log_user int unsigned NOT NULL default 0,
+ -- Name of the user who performed this action
+ log_user_text varchar(255) binary NOT NULL default '',
+
-- Key to the page affected. Where a user is the target,
-- this will point to the user page.
log_namespace int NOT NULL default 0,
log_title varchar(255) binary NOT NULL default '',
+ log_page int unsigned NULL,
-- Freeform text. Interpreted as edit history comments.
log_comment varchar(255) NOT NULL default '',
log_deleted tinyint unsigned NOT NULL default 0
) /*$wgDBTableOptions*/;
-CREATE INDEX type_time ON /*_*/logging (log_type, log_timestamp);
-CREATE INDEX user_time ON /*_*/logging (log_user, log_timestamp);
-CREATE INDEX page_time ON /*_*/logging (log_namespace, log_title, log_timestamp);
-CREATE INDEX times ON /*_*/logging (log_timestamp);
+CREATE INDEX /*i*/type_time ON /*_*/logging (log_type, log_timestamp);
+CREATE INDEX /*i*/user_time ON /*_*/logging (log_user, log_timestamp);
+CREATE INDEX /*i*/page_time ON /*_*/logging (log_namespace, log_title, log_timestamp);
+CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp);
+CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp);
+CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp);
+
+
+CREATE TABLE /*_*/log_search (
+ -- The type of ID (rev ID, log ID, rev timestamp, username)
+ ls_field varbinary(32) NOT NULL,
+ -- The value of the ID
+ ls_value varchar(255) NOT NULL,
+ -- Key to log_id
+ ls_log_id int unsigned NOT NULL default 0
+) /*$wgDBTableOptions*/;
+CREATE UNIQUE INDEX /*i*/ls_field_val ON /*_*/log_search (ls_field,ls_value,ls_log_id);
+CREATE INDEX /*i*/ls_log_id ON /*_*/log_search (ls_log_id);
CREATE TABLE /*_*/trackbacks (
tb_ex text,
tb_name varchar(255)
) /*$wgDBTableOptions*/;
-CREATE INDEX tb_page ON /*_*/trackbacks (tb_page);
+CREATE INDEX /*i*/tb_page ON /*_*/trackbacks (tb_page);
-- Jobs performed by parallel apache threads or a command-line daemon
job_params blob NOT NULL
) /*$wgDBTableOptions*/;
-CREATE INDEX job_cmd ON /*_*/job (job_cmd, job_namespace, job_title);
+CREATE INDEX /*i*/job_cmd ON /*_*/job (job_cmd, job_namespace, job_title, job_params(128));
-- Details of updates to cached special pages
qci_timestamp binary(14) NOT NULL default '19700101000000'
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX qci_type ON /*_*/querycache_info (qci_type);
+CREATE UNIQUE INDEX /*i*/qci_type ON /*_*/querycache_info (qci_type);
-- For each redirect, this table contains exactly one row defining its target
CREATE TABLE /*_*/redirect (
-- Key to the page_id of the redirect page
- rd_from int unsigned NOT NULL default 0 primary key,
+ rd_from int unsigned NOT NULL default 0 PRIMARY KEY,
-- Key to page_namespace/page_title of the target page.
-- The target page may or may not exist, and due to renames
-- and deletions may refer to different page records as time
-- goes by.
rd_namespace int NOT NULL default 0,
- rd_title varchar(255) binary NOT NULL default ''
+ rd_title varchar(255) binary NOT NULL default '',
+ rd_interwiki varchar(32) default NULL,
+ rd_fragment varchar(255) binary default NULL
) /*$wgDBTableOptions*/;
-CREATE INDEX rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from);
+CREATE INDEX /*i*/rd_ns_title ON /*_*/redirect (rd_namespace,rd_title,rd_from);
-- Used for caching expensive grouped queries that need two links (for example double-redirects)
qcc_titletwo varchar(255) binary NOT NULL default ''
) /*$wgDBTableOptions*/;
-CREATE INDEX qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value);
-CREATE INDEX qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title);
-CREATE INDEX qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo);
+CREATE INDEX /*i*/qcc_type ON /*_*/querycachetwo (qcc_type,qcc_value);
+CREATE INDEX /*i*/qcc_title ON /*_*/querycachetwo (qcc_type,qcc_namespace,qcc_title);
+CREATE INDEX /*i*/qcc_titletwo ON /*_*/querycachetwo (qcc_type,qcc_namespacetwo,qcc_titletwo);
-- Used for storing page restrictions (i.e. protection levels)
pr_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type);
-CREATE UNIQUE INDEX pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level);
-CREATE UNIQUE INDEX pr_level ON /*_*/page_restrictions (pr_level);
-CREATE UNIQUE INDEX pr_cascade ON /*_*/page_restrictions (pr_cascade);
+CREATE UNIQUE INDEX /*i*/pr_pagetype ON /*_*/page_restrictions (pr_page,pr_type);
+CREATE INDEX /*i*/pr_typelevel ON /*_*/page_restrictions (pr_type,pr_level);
+CREATE INDEX /*i*/pr_level ON /*_*/page_restrictions (pr_level);
+CREATE INDEX /*i*/pr_cascade ON /*_*/page_restrictions (pr_cascade);
-- Protected titles - nonexistent pages that have been protected
pt_create_perm varbinary(60) NOT NULL
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX pt_namespace ON /*_*/protected_titles (pt_namespace,pt_title);
-CREATE INDEX pt_timestamp ON /*_*/protected_titles (pt_timestamp);
+CREATE UNIQUE INDEX /*i*/pt_namespace_title ON /*_*/protected_titles (pt_namespace,pt_title);
+CREATE INDEX /*i*/pt_timestamp ON /*_*/protected_titles (pt_timestamp);
-- Name/value pairs indexed by page_id
pp_value blob NOT NULL
) /*$wgDBTableOptions*/;
-CREATE UNIQUE INDEX pp_page ON /*_*/page_props (pp_page,pp_propname);
+CREATE UNIQUE INDEX /*i*/pp_page_propname ON /*_*/page_props (pp_page,pp_propname);
-- A table to log updates, one text key row per update.
CREATE TABLE /*_*/updatelog (
- ul_key varchar(255) NOT NULL primary key
+ ul_key varchar(255) NOT NULL PRIMARY KEY
+) /*$wgDBTableOptions*/;
+
+
+-- A table to track tags for revisions, logs and recent changes.
+CREATE TABLE /*_*/change_tag (
+ -- RCID for the change
+ ct_rc_id int NULL,
+ -- LOGID for the change
+ ct_log_id int NULL,
+ -- REVID for the change
+ ct_rev_id int NULL,
+ -- Tag applied
+ ct_tag varchar(255) NOT NULL,
+ -- Parameters for the tag, presently unused
+ ct_params blob NULL
+) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag);
+CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag);
+CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag);
+-- Covering index, so we can pull all the info only out of the index.
+CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id);
+
+
+-- Rollup table to pull a LIST of tags simply without ugly GROUP_CONCAT
+-- that only works on MySQL 4.1+
+CREATE TABLE /*_*/tag_summary (
+ -- RCID for the change
+ ts_rc_id int NULL,
+ -- LOGID for the change
+ ts_log_id int NULL,
+ -- REVID for the change
+ ts_rev_id int NULL,
+ -- Comma-separated list of tags
+ ts_tags blob NOT NULL
+) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id);
+CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id);
+CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id);
+
+
+CREATE TABLE /*_*/valid_tag (
+ vt_tag varchar(255) NOT NULL PRIMARY KEY
+) /*$wgDBTableOptions*/;
+
+-- Table for storing localisation data
+CREATE TABLE /*_*/l10n_cache (
+ -- Language code
+ lc_lang varbinary(32) NOT NULL,
+ -- Cache key
+ lc_key varchar(255) NOT NULL,
+ -- Value
+ lc_value mediumblob NOT NULL
) /*$wgDBTableOptions*/;
+CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key);
-- vim: sw=2 sts=2 et