* Fix up schema per Brion's notes
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Wed, 31 Dec 2008 18:10:50 +0000 (18:10 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Wed, 31 Dec 2008 18:10:50 +0000 (18:10 +0000)
maintenance/archives/patch-user_restrictions.sql
maintenance/tables.sql

index c631bb7..b64146f 100644 (file)
@@ -5,7 +5,7 @@ CREATE TABLE /*$wgDBprefix*/user_restrictions (
        ur_id int NOT NULL auto_increment,
 
        -- Restriction type. Block from either editing namespace or page
-       ur_type varbinary(255) NOT NULL,
+       ur_type ENUM('namespace','page') NOT NULL,
        -- Namespace to restrict if ur_type = namespace
        ur_namespace int default NULL,
        -- Page to restrict if ur_type = page
@@ -14,13 +14,13 @@ CREATE TABLE /*$wgDBprefix*/user_restrictions (
 
        -- User that is restricted
        ur_user int unsigned NOT NULL,
-       ur_user_text tinyblob NOT NULL,
+       ur_user_text varchar(255) NOT NULL,
 
        -- User who has done this restriction
        ur_by int unsigned NOT NULL,
        ur_by_text varchar(255) binary NOT NULL default '',
        -- Reason for this restriction
-       ur_reason tinyblob NOT NULL,
+       ur_reason mediumblob NOT NULL,
 
        -- Time when this restriction was made
        ur_timestamp varbinary(14) NOT NULL default '',
@@ -29,11 +29,11 @@ CREATE TABLE /*$wgDBprefix*/user_restrictions (
 
        PRIMARY KEY ur_id (ur_id),
        -- For looking up restrictions for user and title
-       INDEX ur_user (ur_user,ur_user_text(255)),
+       INDEX ur_user (ur_user),
        INDEX ur_user_page(ur_user,ur_page_namespace,ur_page_title(255)),
        INDEX ur_user_namespace(ur_user,ur_namespace),
        -- For Special:ListUserRestrictions
-       INDEX ur_type (ur_type(255),ur_timestamp),
+       INDEX ur_type (ur_type,ur_timestamp),
        INDEX ur_namespace (ur_namespace,ur_timestamp),
        INDEX ur_page (ur_page_namespace,ur_page_title,ur_timestamp),
        INDEX ur_timestamp (ur_timestamp),
index dcfa35a..a646fcc 100644 (file)
@@ -1249,7 +1249,7 @@ CREATE TABLE /*$wgDBprefix*/user_restrictions (
        ur_id int NOT NULL auto_increment,
 
        -- Restriction type. Block from either editing namespace or page
-       ur_type varbinary(255) NOT NULL,
+       ur_type ENUM('namespace','page') NOT NULL,
        -- Namespace to restrict if ur_type = namespace
        ur_namespace int default NULL,
        -- Page to restrict if ur_type = page
@@ -1258,13 +1258,13 @@ CREATE TABLE /*$wgDBprefix*/user_restrictions (
 
        -- User that is restricted
        ur_user int unsigned NOT NULL,
-       ur_user_text tinyblob NOT NULL,
+       ur_user_text varchar(255) NOT NULL,
 
        -- User who has done this restriction
        ur_by int unsigned NOT NULL,
        ur_by_text varchar(255) binary NOT NULL default '',
        -- Reason for this restriction
-       ur_reason tinyblob NOT NULL,
+       ur_reason mediumblob NOT NULL,
 
        -- Time when this restriction was made
        ur_timestamp varbinary(14) NOT NULL default '',
@@ -1273,11 +1273,11 @@ CREATE TABLE /*$wgDBprefix*/user_restrictions (
 
        PRIMARY KEY ur_id (ur_id),
        -- For looking up restrictions for user and title
-       INDEX ur_user (ur_user,ur_user_text(255)),
+       INDEX ur_user (ur_user),
        INDEX ur_user_page(ur_user,ur_page_namespace,ur_page_title(255)),
        INDEX ur_user_namespace(ur_user,ur_namespace),
        -- For Special:ListUserRestrictions
-       INDEX ur_type (ur_type(255),ur_timestamp),
+       INDEX ur_type (ur_type,ur_timestamp),
        INDEX ur_namespace (ur_namespace,ur_timestamp),
        INDEX ur_page (ur_page_namespace,ur_page_title,ur_timestamp),
        INDEX ur_timestamp (ur_timestamp),