+--
+-- Partial Block Restrictions
+--
+CREATE TABLE /*_*/ipblocks_restrictions (
+
+ -- The ipb_id from ipblocks
+ ir_ipb_id int NOT NULL,
+
+ -- The restriction type id.
+ ir_type tinyint(1) NOT NULL,
+
+ -- The restriction id that corrposponds to the type. Typically a Page ID or a
+ -- Namespace ID.
+ ir_value int NOT NULL,
+
+ PRIMARY KEY (ir_ipb_id, ir_type, ir_value)
+) /*$wgDBTableOptions*/;
+
+-- Index to query restrictions by the page or namespace.
+CREATE INDEX /*i*/ir_type_value ON /*_*/ipblocks_restrictions (ir_type, ir_value);