From 8b9f01ed98136790ecce8482a3a7fdf03029b085 Mon Sep 17 00:00:00 2001 From: Andrew Garrett Date: Thu, 1 Feb 2007 08:58:21 +0000 Subject: [PATCH] * 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] --- maintenance/archives/patch-log_id.sql | 8 ++++++++ maintenance/archives/patch-page_restrictions_sortkey.sql | 8 ++++++++ maintenance/tables.sql | 7 +++++++ maintenance/updaters.inc | 1 + 4 files changed, 24 insertions(+) create mode 100644 maintenance/archives/patch-log_id.sql create mode 100644 maintenance/archives/patch-page_restrictions_sortkey.sql diff --git a/maintenance/archives/patch-log_id.sql b/maintenance/archives/patch-log_id.sql new file mode 100644 index 0000000000..d3f0d3350f --- /dev/null +++ b/maintenance/archives/patch-log_id.sql @@ -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); diff --git a/maintenance/archives/patch-page_restrictions_sortkey.sql b/maintenance/archives/patch-page_restrictions_sortkey.sql new file mode 100644 index 0000000000..8b7e00470e --- /dev/null +++ b/maintenance/archives/patch-page_restrictions_sortkey.sql @@ -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); diff --git a/maintenance/tables.sql b/maintenance/tables.sql index af653fb3ae..024675d4e4 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -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), diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index c042d5f6ac..aed6d7780c 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -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 ) { -- 2.20.1