c631bb7d179fc5c952719f921f06d00964f0a90c
[lhc/web/wiklou.git] / maintenance / archives / patch-user_restrictions.sql
1 -- Allows admins to block user from editing certain namespaces or pages
2
3 CREATE TABLE /*$wgDBprefix*/user_restrictions (
4 -- ID of the restriction
5 ur_id int NOT NULL auto_increment,
6
7 -- Restriction type. Block from either editing namespace or page
8 ur_type varbinary(255) NOT NULL,
9 -- Namespace to restrict if ur_type = namespace
10 ur_namespace int default NULL,
11 -- Page to restrict if ur_type = page
12 ur_page_namespace int default NULL,
13 ur_page_title varchar(255) binary default '',
14
15 -- User that is restricted
16 ur_user int unsigned NOT NULL,
17 ur_user_text tinyblob NOT NULL,
18
19 -- User who has done this restriction
20 ur_by int unsigned NOT NULL,
21 ur_by_text varchar(255) binary NOT NULL default '',
22 -- Reason for this restriction
23 ur_reason tinyblob NOT NULL,
24
25 -- Time when this restriction was made
26 ur_timestamp varbinary(14) NOT NULL default '',
27 -- Expiry or "infinity"
28 ur_expiry varbinary(14) NOT NULL default '',
29
30 PRIMARY KEY ur_id (ur_id),
31 -- For looking up restrictions for user and title
32 INDEX ur_user (ur_user,ur_user_text(255)),
33 INDEX ur_user_page(ur_user,ur_page_namespace,ur_page_title(255)),
34 INDEX ur_user_namespace(ur_user,ur_namespace),
35 -- For Special:ListUserRestrictions
36 INDEX ur_type (ur_type(255),ur_timestamp),
37 INDEX ur_namespace (ur_namespace,ur_timestamp),
38 INDEX ur_page (ur_page_namespace,ur_page_title,ur_timestamp),
39 INDEX ur_timestamp (ur_timestamp),
40 -- For quick removal of expired restrictions
41 INDEX ur_expiry (ur_expiry)
42 ) /*$wgDBTableOptions*/;