+ -- 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 '',
+
+ PRIMARY KEY rd_from (rd_from),
+ KEY rd_ns_title (rd_namespace,rd_title,rd_from)
+) /*$wgDBTableOptions*/;
+
+-- Used for caching expensive grouped queries that need two links (for example double-redirects)
+CREATE TABLE /*$wgDBprefix*/querycachetwo (
+ -- A key name, generally the base name of of the special page.
+ qcc_type varbinary(32) NOT NULL,
+
+ -- Some sort of stored value. Sizes, counts...
+ qcc_value int unsigned NOT NULL default '0',
+
+ -- Target namespace+title
+ qcc_namespace int NOT NULL default '0',
+ qcc_title varchar(255) binary NOT NULL default '',
+
+ -- Target namespace+title2
+ qcc_namespacetwo int NOT NULL default '0',
+ qcc_titletwo varchar(255) binary NOT NULL default '',
+
+ KEY qcc_type (qcc_type,qcc_value),
+ KEY qcc_title (qcc_type,qcc_namespace,qcc_title),
+ KEY qcc_titletwo (qcc_type,qcc_namespacetwo,qcc_titletwo)
+
+) /*$wgDBTableOptions*/;
+
+-- Used for storing page restrictions (i.e. protection levels)
+CREATE TABLE /*$wgDBprefix*/page_restrictions (
+ -- Page to apply restrictions to (Foreign Key to page).
+ pr_page int NOT NULL,
+ -- The protection type (edit, move, etc)
+ pr_type varbinary(60) NOT NULL,
+ -- The protection level (Sysop, autoconfirmed, etc)
+ pr_level varbinary(60) NOT NULL,
+ -- Whether or not to cascade the protection down to pages transcluded.
+ pr_cascade tinyint NOT NULL,
+ -- Field for future support of per-user restriction.
+ pr_user int NULL,
+ -- Field for time-limited protection.
+ pr_expiry varbinary(14) NULL,
+ -- Field for an ID for this restrictions row (sort-key for Special:ProtectedPages)
+ pr_id int unsigned NOT NULL auto_increment,
+
+ PRIMARY KEY pr_pagetype (pr_page,pr_type),
+
+ UNIQUE KEY pr_id (pr_id),
+ KEY pr_typelevel (pr_type,pr_level),
+ KEY pr_level (pr_level),
+ KEY pr_cascade (pr_cascade)
+) /*$wgDBTableOptions*/;
+
+-- vim: sw=2 sts=2 et