* 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]
This commit is contained in:
Andrew Garrett 2007-02-01 08:58:21 +00:00
parent d2a3135818
commit 8b9f01ed98
4 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,8 @@
-- Log_id field that means one log entry can be referred to with a single number,
-- rather than a dirty great big mess of features.
-- This might be useful for single-log-entry deletion, et cetera.
-- Andrew Garrett, February 2007.
ALTER TABLE logging
ADD COLUMN log_id SERIAL,
ADD PRIMARY KEY log_id (log_id);

View file

@ -0,0 +1,8 @@
-- Add a sort-key to page_restrictions table.
-- First immediate use of this is as a sort-key for coming modifications
-- of Special:Protectedpages.
-- Andrew Garrett, February 2007
ALTER TABLE page_restrictions
ADD COLUMN pr_id SERIAL,
ADD UNIQUE KEY pr_id (pr_id);

View file

@ -982,6 +982,10 @@ CREATE TABLE /*$wgDBprefix*/logging (
-- LF separated list of miscellaneous parameters
log_params blob NOT NULL,
-- Log ID, for referring to this specific log entry, probably for deletion and such.
log_id int unsigned not null auto_increment,
PRIMARY KEY log_id (log_id),
KEY type_time (log_type, log_timestamp),
KEY user_time (log_user, log_timestamp),
KEY page_time (log_namespace, log_title, log_timestamp),
@ -1089,9 +1093,12 @@ CREATE TABLE /*$wgDBprefix*/page_restrictions (
pr_user int(8) NULL,
-- Field for time-limited protection.
pr_expiry char(14) binary 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_page,pr_type),
UNIQUE KEY pr_id (pr_id),
KEY pr_page (pr_page),
KEY pr_typelevel (pr_type,pr_level),
KEY pr_level (pr_level),

View file

@ -66,6 +66,7 @@ $wgNewFields = array(
array( 'ipblocks', 'ipb_enable_autoblock', 'patch-ipb_optional_autoblock.sql' ),
array( 'user', 'user_newpass_time','patch-user_newpass_time.sql' ),
array( 'user', 'user_editcount', 'patch-user_editcount.sql' ),
array( 'logging', 'log_id', 'patch-log_id.sql' ),
);
function rename_table( $from, $to, $patch ) {