-- Optional 'real name' to be displayed in credit listings
user_real_name varchar(255) binary NOT NULL default '',
- -- Password hashes, normally hashed like so:
- -- MD5(CONCAT(user_id,'-',MD5(plaintext_password))), see
- -- wfEncryptPassword() in GlobalFunctions.php
+ -- Password hashes, see User::crypt() and User::comparePasswords()
+ -- in User.php for the algorithm
user_password tinyblob NOT NULL,
-- When using 'mail me a new password', a random
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);
+CREATE INDEX /*i*/ar_page_revid ON /*_*/archive (ar_namespace, ar_title, ar_rev_id);
--
-- all such pages are in namespace 14 (NS_CATEGORY).
cl_to varchar(255) binary NOT NULL default '',
- -- The title of the linking page, or an optional override
- -- to determine sort order. Sorting is by binary order, which
- -- isn't always ideal, but collations seem to be an exciting
- -- and dangerous new world in MySQL... The sortkey is updated
- -- if no override exists and cl_from is renamed.
- --
- -- Truncate so that the cl_sortkey key fits in 1000 bytes
- -- (MyISAM 5 with server_character_set=utf8)
- cl_sortkey varchar(70) binary NOT NULL default '',
+ -- A binary string obtained by applying a sortkey generation algorithm
+ -- (Language::convertToSortkey()) to page_title, or cl_sortkey_prefix . "\0"
+ -- . page_title if cl_sortkey_prefix is nonempty.
+ cl_sortkey varbinary(230) NOT NULL default '',
+
+ -- A prefix for the raw sortkey manually specified by the user, either via
+ -- [[Category:Foo|prefix]] or {{defaultsort:prefix}}. If nonempty, it's
+ -- concatenated with a null followed by the page title before the sortkey
+ -- conversion algorithm is run. We store this so that we can update
+ -- collations without reparsing all pages.
+ cl_sortkey_prefix varchar(255) binary NOT NULL default '',
-- This isn't really used at present. Provided for an optional
-- sorting method by approximate addition time.
- cl_timestamp timestamp NOT NULL
+ cl_timestamp timestamp NOT NULL,
+
+ -- Stores $wgCategoryCollation at the time cl_sortkey was generated. This
+ -- can be used to install new collation versions, tracking which rows are not
+ -- yet updated. '' means no collation, this is a legacy row that needs to be
+ -- updated by updateCollation.php. In the future, it might be possible to
+ -- specify different collations per category.
+ cl_collation varbinary(32) NOT NULL default '',
+
+ -- Stores whether cl_from is a category, file, or other page, so we can
+ -- paginate the three categories separately. This never has to be updated
+ -- after the page is created, since none of these page types can be moved to
+ -- any other.
+ cl_type ENUM('page', 'subcat', 'file') NOT NULL default 'page'
) /*$wgDBTableOptions*/;
CREATE UNIQUE INDEX /*i*/cl_from ON /*_*/categorylinks (cl_from,cl_to);
--- We always sort within a given category...
-CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_sortkey,cl_from);
+-- We always sort within a given category, and within a given type. FIXME:
+-- Formerly this index didn't cover cl_type (since that didn't exist), so old
+-- callers won't be using an index: fix this?
+CREATE INDEX /*i*/cl_sortkey ON /*_*/categorylinks (cl_to,cl_type,cl_sortkey,cl_from);
-- Not really used?
CREATE INDEX /*i*/cl_timestamp ON /*_*/categorylinks (cl_to,cl_timestamp);
+-- For finding rows with outdated collation
+CREATE INDEX /*i*/cl_collation ON /*_*/categorylinks (cl_collation);
--
-- Track all existing categories. Something is a category if 1) it has an en-
CREATE INDEX /*i*/ll_lang ON /*_*/langlinks (ll_lang, ll_title);
+--
+-- Track inline interwiki links
+--
+CREATE TABLE /*_*/iwlinks (
+ -- page_id of the referring page
+ iwl_from int unsigned NOT NULL default 0,
+
+ -- Interwiki prefix code of the target
+ iwl_prefix varbinary(20) NOT NULL default '',
+
+ -- Title of the target, including namespace
+ iwl_title varchar(255) binary NOT NULL default ''
+) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title);
+CREATE UNIQUE INDEX /*i*/iwl_prefix_title_from ON /*_*/iwlinks (iwl_prefix, iwl_title, iwl_from);
+
+
--
-- Contains a single row with some aggregate info
-- on the state of the site.
-- insertion.
iw_url blob NOT NULL,
+ -- The URL of the file api.php
+ iw_api blob NOT NULL,
+
+ -- The name of the database (for a connection to be established with wfGetLB( 'wikiid' ))
+ iw_wikiid varchar(64) NOT NULL,
+
-- A boolean value indicating whether the wiki is in this project
-- (used, for example, to detect redirect loops)
iw_local bool NOT NULL,
-- 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,
+ ul_value blob
) /*$wgDBTableOptions*/;
) /*$wgDBTableOptions*/;
CREATE INDEX /*i*/lc_lang_key ON /*_*/l10n_cache (lc_lang, lc_key);
+-- Table for storing JSON message blobs for the resource loader
+CREATE TABLE /*_*/msg_resource (
+ -- Resource name
+ mr_resource varchar(255) NOT NULL,
+ -- Language code
+ mr_lang varbinary(32) NOT NULL,
+ -- JSON blob
+ mr_blob mediumblob NOT NULL,
+ -- Timestamp of last update
+ mr_timestamp binary(14) NOT NULL
+) /*$wgDBTableOptions*/;
+CREATE UNIQUE INDEX /*i*/mr_resource_lang ON /*_*/msg_resource (mr_resource, mr_lang);
+
+-- Table for administering which message is contained in which resource
+CREATE TABLE /*_*/msg_resource_links (
+ mrl_resource varchar(255) NOT NULL,
+ -- Message key
+ mrl_message varchar(255) NOT NULL
+) /*$wgDBTableOptions*/;
+CREATE UNIQUE INDEX /*i*/mrl_message_resource ON /*_*/msg_resource_links (mrl_message, mrl_resource);
+
+-- Table for tracking which local files a module depends on that aren't
+-- registered directly.
+-- Currently only used for tracking images that CSS depends on
+CREATE TABLE /*_*/module_deps (
+ -- Module name
+ md_module varchar(255) NOT NULL,
+ -- Skin name
+ md_skin varchar(32) NOT NULL,
+ -- JSON blob with file dependencies
+ md_deps mediumblob NOT NULL
+) /*$wgDBTableOptions*/;
+CREATE UNIQUE INDEX /*i*/md_module_skin ON /*_*/module_deps (md_module, md_skin);
+
-- vim: sw=2 sts=2 et