r19703 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r19702‎ | r19703 | r19704 >
Date:08:58, 1 February 2007
Author:werdna
Status:old
Tags:
Comment:
* Schema changes - add id fields to page_restrictions and logging tables for future functionality (log entry deletion, rewrite of Special:Protectedpages)
[RELEASE-NOTES update to come from another computer, something funky's going on with another line in RELEASE-NOTES]
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-log_id.sql (added) (history)
  • /trunk/phase3/maintenance/archives/patch-page_restrictions_sortkey.sql (added) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-log_id.sql
@@ -0,0 +1,8 @@
 2+-- Log_id field that means one log entry can be referred to with a single number,
 3+-- rather than a dirty great big mess of features.
 4+-- This might be useful for single-log-entry deletion, et cetera.
 5+-- Andrew Garrett, February 2007.
 6+
 7+ALTER TABLE logging
 8+ ADD COLUMN log_id SERIAL,
 9+ ADD PRIMARY KEY log_id (log_id);
Index: trunk/phase3/maintenance/archives/patch-page_restrictions_sortkey.sql
@@ -0,0 +1,8 @@
 2+-- Add a sort-key to page_restrictions table.
 3+-- First immediate use of this is as a sort-key for coming modifications
 4+-- of Special:Protectedpages.
 5+-- Andrew Garrett, February 2007
 6+
 7+ALTER TABLE page_restrictions
 8+ ADD COLUMN pr_id SERIAL,
 9+ ADD UNIQUE KEY pr_id (pr_id);
Index: trunk/phase3/maintenance/updaters.inc
@@ -66,6 +66,7 @@
6767 array( 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
6868 array( 'user', 'user_newpass_time','patch-user_newpass_time.sql' ),
6969 array( 'user', 'user_editcount', 'patch-user_editcount.sql' ),
 70+ array( 'logging', 'log_id', 'patch-log_id.sql' ),
7071 );
7172
7273 function rename_table( $from, $to, $patch ) {
Index: trunk/phase3/maintenance/tables.sql
@@ -982,6 +982,10 @@
983983 -- LF separated list of miscellaneous parameters
984984 log_params blob NOT NULL,
985985
 986+ -- Log ID, for referring to this specific log entry, probably for deletion and such.
 987+ log_id int unsigned not null auto_increment,
 988+
 989+ PRIMARY KEY log_id (log_id),
986990 KEY type_time (log_type, log_timestamp),
987991 KEY user_time (log_user, log_timestamp),
988992 KEY page_time (log_namespace, log_title, log_timestamp),
@@ -1089,9 +1093,12 @@
10901094 pr_user int(8) NULL,
10911095 -- Field for time-limited protection.
10921096 pr_expiry char(14) binary NULL,
 1097+ -- Field for an ID for this restrictions row (sort-key for Special:ProtectedPages)
 1098+ pr_id int unsigned not null auto_increment,
10931099
10941100 PRIMARY KEY (pr_page,pr_type),
10951101
 1102+ UNIQUE KEY pr_id (pr_id),
10961103 KEY pr_page (pr_page),
10971104 KEY pr_typelevel (pr_type,pr_level),
10981105 KEY pr_level (pr_level),