added /*$wgDBprefix*/ in various places, to support upgrading from old prefixed datab...
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 14 Jan 2005 13:33:17 +0000 (13:33 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 14 Jan 2005 13:33:17 +0000 (13:33 +0000)
35 files changed:
maintenance/archives/patch-bot.sql
maintenance/archives/patch-cache.sql
maintenance/archives/patch-categorylinks.sql
maintenance/archives/patch-hitcounter.sql
maintenance/archives/patch-image_name_primary.sql
maintenance/archives/patch-image_name_unique.sql
maintenance/archives/patch-indexes.sql
maintenance/archives/patch-interwiki.sql
maintenance/archives/patch-ipb_expiry.sql
maintenance/archives/patch-ipblocks.sql
maintenance/archives/patch-linkscc-1.3.sql
maintenance/archives/patch-linkscc.sql
maintenance/archives/patch-linktables.sql
maintenance/archives/patch-logging.sql
maintenance/archives/patch-math.sql
maintenance/archives/patch-objectcache.sql
maintenance/archives/patch-oldestindex.sql
maintenance/archives/patch-parsercache.sql
maintenance/archives/patch-profiling.sql
maintenance/archives/patch-querycache.sql
maintenance/archives/patch-random-dateindex.sql
maintenance/archives/patch-rc-newindex.sql
maintenance/archives/patch-rc-patrol.sql
maintenance/archives/patch-rc_id.sql
maintenance/archives/patch-rc_ip.sql
maintenance/archives/patch-rc_type.sql
maintenance/archives/patch-rename-user_groups-and_rights.sql
maintenance/archives/patch-searchindex.sql
maintenance/archives/patch-user_rights.sql
maintenance/archives/patch-user_token.sql
maintenance/archives/patch-userindex.sql
maintenance/archives/patch-userlevels-rights.sql
maintenance/archives/patch-userlevels.sql
maintenance/archives/patch-usernewtalk.sql
maintenance/archives/patch-validate.sql

index c171afa..ce61884 100644 (file)
@@ -6,6 +6,6 @@
 -- this affects code in Article.php, User.php SpecialRecentchanges.php
 -- column also added to buildTables.inc
 
-ALTER TABLE recentchanges
+ALTER TABLE /*$wgDBprefix*/recentchanges
   ADD COLUMN rc_bot tinyint(3) unsigned NOT NULL default '0'
   AFTER rc_minor;
index 6ce484b..5651c3c 100644 (file)
 -- timestamps of cached pages to ensure consistency; if
 -- cur_touched is later, the page must be regenerated.
 
-ALTER TABLE cur
+ALTER TABLE /*$wgDBprefix*/cur
   ADD COLUMN cur_touched char(14) binary NOT NULL default '';
 
 -- Existing pages should be initialized to the current
 -- time so they don't needlessly rerender until they are
 -- changed for the first time:
 
-UPDATE cur
+UPDATE /*$wgDBprefix*/cur
   SET cur_touched=NOW()+0;
 
 -- user_touched should be set to the current time whenever:
@@ -35,7 +35,7 @@ UPDATE cur
 -- time, the page should be rerendered with new options and
 -- sent again.
 
-ALTER TABLE user
+ALTER TABLE /*$wgDBprefix*/user
   ADD COLUMN user_touched char(14) binary NOT NULL default '';
-UPDATE user
+UPDATE /*$wgDBprefix*/user
   SET user_touched=NOW()+0;
index 962a0ad..9856235 100644 (file)
@@ -4,7 +4,7 @@
 -- cl_sortkey is the title of the linking page or an optional override
 -- cl_timestamp marks when the link was last added
 --
-CREATE TABLE categorylinks (
+CREATE TABLE /*$wgDBprefix*/categorylinks (
   cl_from int(8) unsigned NOT NULL default '0',
   cl_to varchar(255) binary NOT NULL default '',
   cl_sortkey varchar(255) binary NOT NULL default '',
index 169081f..260f717 100644 (file)
@@ -4,6 +4,6 @@
 -- December 2003
 --
 
-CREATE TABLE hitcounter (
+CREATE TABLE /*$wgDBprefix*/hitcounter (
   hc_id INTEGER UNSIGNED NOT NULL
 ) TYPE=HEAP MAX_ROWS=25000;
index d584d09..5bd8826 100644 (file)
@@ -1,6 +1,6 @@
 -- Make the image name index unique
 
-ALTER TABLE image DROP INDEX img_name;
+ALTER TABLE /*$wgDBprefix*/image DROP INDEX img_name;
 
-ALTER TABLE image
+ALTER TABLE /*$wgDBprefix*/image
   ADD PRIMARY KEY img_name (img_name);
index 118b068..5cf02d4 100644 (file)
@@ -1,6 +1,6 @@
 -- Make the image name index unique
 
-ALTER TABLE image DROP INDEX img_name;
+ALTER TABLE /*$wgDBprefix*/image DROP INDEX img_name;
 
-ALTER TABLE image
+ALTER TABLE /*$wgDBprefix*/image
   ADD UNIQUE INDEX img_name (img_name);
index 58fb365..23eec07 100644 (file)
@@ -4,21 +4,21 @@
 -- Fix up table indexes; new to stable release in November 2003
 -- 
 
-ALTER TABLE links
+ALTER TABLE /*$wgDBprefix*/links
    DROP INDEX l_from,
    ADD INDEX l_from (l_from);
 
-ALTER TABLE brokenlinks
+ALTER TABLE /*$wgDBprefix*/brokenlinks
    DROP INDEX bl_to,
    ADD INDEX bl_to (bL_to);
 
-ALTER TABLE recentchanges
+ALTER TABLE /*$wgDBprefix*/recentchanges
    ADD INDEX rc_timestamp (rc_timestamp),
    ADD INDEX rc_namespace_title (rc_namespace, rc_title),
    ADD INDEX rc_cur_id (rc_cur_id);
 
-ALTER TABLE archive
+ALTER TABLE /*$wgDBprefix*/archive
    ADD KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp);
 
-ALTER TABLE watchlist
+ALTER TABLE /*$wgDBprefix*/watchlist
    ADD KEY namespace_title (wl_namespace,wl_title);
index 0fa40cd..e4f3b6f 100644 (file)
@@ -2,7 +2,7 @@
 -- used from 2003-08-21 dev version.
 -- Import the default mappings from maintenance/interwiki.sql
 
-CREATE TABLE interwiki (
+CREATE TABLE /*$wgDBprefix*/interwiki (
   iw_prefix char(32) NOT NULL,
   iw_url char(127) NOT NULL,
   iw_local BOOL NOT NULL,
index d41c877..0f106d7 100644 (file)
@@ -1,8 +1,8 @@
 -- Adds the ipb_expiry field to ipblocks
 
-ALTER TABLE ipblocks ADD ipb_expiry char(14) binary NOT NULL default '';
+ALTER TABLE /*$wgDBprefix*/ipblocks ADD ipb_expiry char(14) binary NOT NULL default '';
 
 -- All IP blocks have one day expiry
-UPDATE ipblocks SET ipb_expiry = date_format(date_add(ipb_timestamp,INTERVAL 1 DAY),"%Y%m%d%H%i%s") WHERE ipb_user = 0;
+UPDATE /*$wgDBprefix*/ipblocks SET ipb_expiry = date_format(date_add(ipb_timestamp,INTERVAL 1 DAY),"%Y%m%d%H%i%s") WHERE ipb_user = 0;
 
 -- Null string is fine for user blocks, since this indicates infinity
index c1eb2a9..8e47798 100644 (file)
@@ -1,6 +1,6 @@
 -- For auto-expiring blocks --
 
-ALTER TABLE ipblocks
+ALTER TABLE /*$wgDBprefix*/ipblocks
        ADD ipb_auto tinyint(1) NOT NULL default '0',
        ADD ipb_id int(8) NOT NULL auto_increment,
        ADD PRIMARY KEY (ipb_id);
index 6f9e631..e397fcb 100644 (file)
@@ -3,4 +3,4 @@
 -- New schema for 1.3 - removes old lcc_title column.
 -- May 2004
 --
-ALTER TABLE linkscc DROP COLUMN lcc_title;
\ No newline at end of file
+ALTER TABLE /*$wgDBprefix*/linkscc DROP COLUMN lcc_title;
\ No newline at end of file
index 32370b7..4be2bde 100644 (file)
@@ -3,7 +3,7 @@
 -- November 2003
 --
 
-CREATE TABLE IF NOT EXISTS linkscc (
+CREATE TABLE IF NOT EXISTS /*$wgDBprefix*/linkscc (
   lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY,
   lcc_title VARCHAR(255) binary NOT NULL UNIQUE KEY,
   lcc_cacheobj MEDIUMBLOB NOT NULL);
index 5293411..45361e8 100644 (file)
@@ -2,8 +2,8 @@
 -- Track links that do exist
 -- l_from and l_to key to cur_id
 --
-DROP TABLE IF EXISTS links;
-CREATE TABLE links (
+DROP TABLE IF EXISTS /*$wgDBprefix*/links;
+CREATE TABLE /*$wgDBprefix*/links (
   l_from int(8) unsigned NOT NULL default '0',
   l_to int(8) unsigned NOT NULL default '0',
   UNIQUE KEY l_from(l_from,l_to),
@@ -15,8 +15,8 @@ CREATE TABLE links (
 -- bl_from keys to cur_id
 -- bl_to is a text link (namespace:title)
 --
-DROP TABLE IF EXISTS brokenlinks;
-CREATE TABLE brokenlinks (
+DROP TABLE IF EXISTS /*$wgDBprefix*/brokenlinks;
+CREATE TABLE /*$wgDBprefix*/brokenlinks (
   bl_from int(8) unsigned NOT NULL default '0',
   bl_to varchar(255) binary NOT NULL default '',
   UNIQUE KEY bl_from(bl_from,bl_to),
@@ -28,8 +28,8 @@ CREATE TABLE brokenlinks (
 -- il_from keys to cur_id, il_to keys to image_name.
 -- We don't distinguish live from broken links.
 --
-DROP TABLE IF EXISTS imagelinks;
-CREATE TABLE imagelinks (
+DROP TABLE IF EXISTS /*$wgDBprefix*/imagelinks;
+CREATE TABLE /*$wgDBprefix*/imagelinks (
   il_from int(8) unsigned NOT NULL default '0',
   il_to varchar(255) binary NOT NULL default '',
   UNIQUE KEY il_from(il_from,il_to),
@@ -41,8 +41,8 @@ CREATE TABLE imagelinks (
 -- cache arrays to reduce database load slurping up
 -- from links and brokenlinks.
 --
-DROP TABLE IF EXISTS linkscc;
-CREATE TABLE linkscc (
+DROP TABLE IF EXISTS /*$wgDBprefix*/linkscc;
+CREATE TABLE /*$wgDBprefix*/linkscc (
   lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY,
   lcc_cacheobj MEDIUMBLOB NOT NULL
 );
index 7922fa6..44d6d9e 100644 (file)
@@ -1,7 +1,7 @@
 -- Add the logging table and adjust recentchanges to accomodate special pages
 -- 2004-08-24
 
-CREATE TABLE logging (
+CREATE TABLE /*$wgDBprefix*/logging (
   -- Symbolic keys for the general log type and the action type
   -- within the log. The output format will be controlled by the
   -- action field, but only the type controls categorization.
index 430fb7a..5deba0d 100644 (file)
@@ -5,8 +5,8 @@
 -- Note: math table has changed, and this script needs to be run again
 -- to create it. (2003-02-02)
 
-DROP TABLE IF EXISTS math;
-CREATE TABLE math (
+DROP TABLE IF EXISTS /*$wgDBprefix*/math;
+CREATE TABLE /*$wgDBprefix*/math (
     math_inputhash varchar(16) NOT NULL,
     math_outputhash varchar(16) NOT NULL,
     math_html_conservativeness tinyint(1) NOT NULL,
index 7d79c74..86a2f1b 100644 (file)
@@ -1,5 +1,5 @@
 -- For a few generic cache operations if not using Memcached
-CREATE TABLE objectcache (
+CREATE TABLE /*$wgDBprefix*/objectcache (
   keyname char(255) binary not null default '',
   value mediumblob,
   exptime datetime,
index 79b0332..930214f 100644 (file)
@@ -1,5 +1,5 @@
 -- Add index for "Oldest articles" (Special:Ancientpages)
 -- 2003-05-23 Erik Moeller <moeller@scireview.de>
 
-ALTER TABLE cur
+ALTER TABLE /*$wgDBprefix*/cur
    ADD INDEX namespace_redirect_timestamp(cur_namespace,cur_is_redirect,cur_timestamp);
index 533a206..854e6c5 100644 (file)
@@ -3,7 +3,7 @@
 -- before they are imbedded in the skin.
 --
 
-CREATE TABLE parsercache (
+CREATE TABLE /*$wgDBprefix*/parsercache (
   pc_pageid INT(11) NOT NULL,
   pc_title VARCHAR(255) NOT NULL,
   pc_prefhash CHAR(32) NOT NULL,
index ea9974c..1b22778 100644 (file)
@@ -1,7 +1,7 @@
 -- profiling table
 -- This is optional
 
-CREATE TABLE profiling (
+CREATE TABLE /*$wgDBprefix*/profiling (
        pf_count integer not null default 0,
        pf_time float not null default 0,
        pf_name varchar(255) not null default '',
index d4a1b8e..980af49 100644 (file)
@@ -1,6 +1,6 @@
 -- Used for caching expensive grouped queries
 
-CREATE TABLE querycache (
+CREATE TABLE /*$wgDBprefix*/querycache (
   qc_type char(32) NOT NULL,
   qc_value int(5) unsigned NOT NULL default '0',
   qc_namespace tinyint(2) unsigned NOT NULL default '0',
index e239827..5d514cc 100644 (file)
@@ -23,7 +23,7 @@
 -- cur and old need (user,timestamp) index for contribs
 -- cur and old need (user_text,timestamp) index for contribs
 
-ALTER TABLE cur
+ALTER TABLE /*$wgDBprefix*/cur
   DROP INDEX cur_user,
   DROP INDEX cur_user_text,
   ADD COLUMN cur_random real unsigned NOT NULL,
@@ -33,11 +33,11 @@ ALTER TABLE cur
   ADD INDEX user_timestamp (cur_user,inverse_timestamp),
   ADD INDEX usertext_timestamp (cur_user_text,inverse_timestamp);
 
-UPDATE cur SET
+UPDATE /*$wgDBprefix*/cur SET
   inverse_timestamp=99999999999999-cur_timestamp,
   cur_random=RAND();
 
-ALTER TABLE old
+ALTER TABLE /*$wgDBprefix*/old
   DROP INDEX old_user,
   DROP INDEX old_user_text,
   ADD COLUMN inverse_timestamp char(14) binary NOT NULL default '',
@@ -45,10 +45,10 @@ ALTER TABLE old
   ADD INDEX user_timestamp (old_user,inverse_timestamp),
   ADD INDEX usertext_timestamp (old_user_text,inverse_timestamp);
 
-UPDATE old SET
+UPDATE /*$wgDBprefix*/old SET
   inverse_timestamp=99999999999999-old_timestamp;
 
 -- If leaving wiki publicly accessible in read-only mode during
 -- the upgrade, comment out the below line; leave 'random' table
 -- in place until the new software is installed.
-DROP TABLE random;
+DROP TABLE /*$wgDBprefix*/random;
index 5a6897e..2315ff3 100644 (file)
@@ -4,6 +4,6 @@
 -- 2004-01-25
 --
 
-ALTER TABLE recentchanges
+ALTER TABLE /*$wgDBprefix*/recentchanges
        ADD INDEX new_name_timestamp(rc_new,rc_namespace,rc_timestamp);
 
index 51fd3c6..1839c1e 100755 (executable)
@@ -4,6 +4,6 @@
 -- 2004-08-09
 --
 
-ALTER TABLE recentchanges
+ALTER TABLE /*$wgDBprefix*/recentchanges
        ADD COLUMN rc_patrolled tinyint(3) unsigned NOT NULL default '0';
 
index 3adbbf9..6dd9ef4 100644 (file)
@@ -1,6 +1,6 @@
 -- Primary key in recentchanges
 
-ALTER TABLE recentchanges 
+ALTER TABLE /*$wgDBprefix*/recentchanges 
   ADD rc_id int(8) NOT NULL auto_increment,
   ADD PRIMARY KEY rc_id (rc_id);
 
index 6106d93..a68a22c 100644 (file)
@@ -1,6 +1,6 @@
 -- Adding the rc_ip field for logging of IP addresses in recentchanges
 
-ALTER TABLE recentchanges 
+ALTER TABLE /*$wgDBprefix*/recentchanges 
   ADD rc_ip char(15) NOT NULL default '',
   ADD INDEX rc_ip (rc_ip);
 
index 24db10e..1097771 100644 (file)
@@ -1,9 +1,9 @@
 -- recentchanges improvements --
 
-ALTER TABLE recentchanges
+ALTER TABLE /*$wgDBprefix*/recentchanges
   ADD rc_type tinyint(3) unsigned NOT NULL default '0',
   ADD rc_moved_to_ns tinyint(3) unsigned NOT NULL default '0',
   ADD rc_moved_to_title varchar(255) binary NOT NULL default '';
 
-UPDATE recentchanges SET rc_type=1 WHERE rc_new;
-UPDATE recentchanges SET rc_type=3 WHERE rc_namespace=4 AND (rc_title='Deletion_log' OR rc_title='Upload_log');
+UPDATE /*$wgDBprefix*/recentchanges SET rc_type=1 WHERE rc_new;
+UPDATE /*$wgDBprefix*/recentchanges SET rc_type=3 WHERE rc_namespace=4 AND (rc_title='Deletion_log' OR rc_title='Upload_log');
index 4845d3c..abd5931 100644 (file)
@@ -1,9 +1,9 @@
 
-ALTER TABLE user_groups
+ALTER TABLE /*$wgDBprefix*/user_groups
        CHANGE user_id ug_user INT(5) UNSIGNED NOT NULL DEFAULT '0',
        CHANGE group_id ug_group INT(5) UNSIGNED NOT NULL DEFAULT '0';
 
-ALTER TABLE user_rights
+ALTER TABLE /*$wgDBprefix*/user_rights
        CHANGE user_id ur_user INT(5) UNSIGNED NOT NULL,
        CHANGE user_rights ur_rights TINYBLOB NOT NULL DEFAULT '';
 
index aafe21f..a9f4cdb 100644 (file)
@@ -6,8 +6,8 @@
 -- 2002-12-16, 2003-01-25 Brion VIBBER <brion@pobox.com>
 
 -- Creating searchindex table...
-DROP TABLE IF EXISTS searchindex;
-CREATE TABLE searchindex (
+DROP TABLE IF EXISTS /*$wgDBprefix*/searchindex;
+CREATE TABLE /*$wgDBprefix*/searchindex (
   si_page int(8) unsigned NOT NULL,
   si_title varchar(255) NOT NULL default '',
   si_text mediumtext NOT NULL default '',
@@ -15,19 +15,19 @@ CREATE TABLE searchindex (
 ) TYPE=MyISAM PACK_KEYS=1;
 
 -- Copying data into new table...
-INSERT INTO searchindex
+INSERT INTO /*$wgDBprefix*/searchindex
   (si_page,si_title,si_text)
   SELECT
     cur_id,cur_ind_title,cur_ind_text
-    FROM cur;
+    FROM /*$wgDBprefix*/cur;
 
 
 -- Creating fulltext index...
-ALTER TABLE searchindex
+ALTER TABLE /*$wgDBprefix*/searchindex
   ADD FULLTEXT si_title (si_title),
   ADD FULLTEXT si_text (si_text);
 
 -- Dropping index columns from cur table.
-ALTER TABLE cur
+ALTER TABLE /*$wgDBprefix*/cur
   DROP COLUMN cur_ind_title,
   DROP COLUMN cur_ind_text;
index b99e229..1eefb3d 100644 (file)
@@ -5,12 +5,12 @@
 -- you can store the accounts for several wikis in one central
 -- database but keep user rights local to the wiki.
 
-CREATE TABLE user_rights (
+CREATE TABLE /*$wgDBprefix*/user_rights (
        ur_user int(5) unsigned NOT NULL,
        ur_rights tinyblob NOT NULL default '',
        UNIQUE KEY ur_user (ur_user)
 ) PACK_KEYS=1;
 
-INSERT INTO user_rights SELECT user_id,user_rights FROM user;
+INSERT INTO /*$wgDBprefix*/user_rights SELECT user_id,user_rights FROM /*$wgDBprefix*/user;
 
-ALTER TABLE user DROP COLUMN user_rights;
+ALTER TABLE /*$wgDBprefix*/user DROP COLUMN user_rights;
index 02d0420..797dc98 100644 (file)
@@ -1,9 +1,9 @@
 -- user_token patch
 -- 2004-09-23
 
-ALTER TABLE user ADD user_token char(32) binary NOT NULL default '';
+ALTER TABLE /*$wgDBprefix*/user ADD user_token char(32) binary NOT NULL default '';
 
-UPDATE user SET user_token = concat(
+UPDATE /*$wgDBprefix*/user SET user_token = concat(
        substring(rand(),3,4),
        substring(rand(),3,4),
        substring(rand(),3,4),
index 4a178dd..c039b2f 100644 (file)
@@ -1 +1 @@
- ALTER TABLE `user` ADD INDEX ( `user_name` );
\ No newline at end of file
+ ALTER TABLE /*$wgDBprefix*/user ADD INDEX ( `user_name` );
\ No newline at end of file
index 9082c28..aff208d 100644 (file)
@@ -2,4 +2,4 @@
 -- Adds the group_rights field missing from early dev work
 
 -- Hold group name and description
-ALTER TABLE `group` ADD group_rights tinyblob;
+ALTER TABLE /*$wgDBprefix*/`group` ADD group_rights tinyblob;
index ccaa266..18502c9 100644 (file)
@@ -4,7 +4,7 @@
 -- This is under development to provide a showcase in HEAD :o)
 
 -- Hold group name and description
-CREATE TABLE `group` (
+CREATE TABLE /*$wgDBprefix*/`group` (
   group_id int(5) unsigned NOT NULL auto_increment,
   group_name varchar(50) NOT NULL default '',
   group_description varchar(255) NOT NULL default '',
@@ -13,7 +13,7 @@ CREATE TABLE `group` (
 );
 
 -- Relation table between user and groups
-CREATE TABLE user_groups (
+CREATE TABLE /*$wgDBprefix*/user_groups (
        ug_user int(5) unsigned NOT NULL default '0',
        ug_group int(5) unsigned NOT NULL default '0',
        PRIMARY KEY  (ug_user,ug_group)
index 735f2cb..fb8c865 100644 (file)
@@ -4,7 +4,7 @@
 --- The respective column in the user table is no longer
 --- required and therefore dropped.
 
-CREATE TABLE user_newtalk (
+CREATE TABLE /*$wgDBprefix*/user_newtalk (
   user_id int(5) NOT NULL default '0',
   user_ip varchar(40) NOT NULL default '',
   KEY user_id (user_id),
@@ -12,9 +12,9 @@ CREATE TABLE user_newtalk (
 ) TYPE=MyISAM;
 
 INSERT INTO
-  user_newtalk (user_id, user_ip)
+  /*$wgDBprefix*/user_newtalk (user_id, user_ip)
   SELECT user_id, ''
     FROM user
     WHERE user_newtalk != 0;
 
-ALTER TABLE user DROP COLUMN user_newtalk;
+ALTER TABLE /*$wgDBprefix*/user DROP COLUMN user_newtalk;
index c05884d..8c77462 100644 (file)
@@ -1,6 +1,6 @@
 -- For article validation
 
-CREATE TABLE `validate` (
+CREATE TABLE /*$wgDBprefix*/validate (
   `val_user` int(11) NOT NULL default '0',
   `val_title` varchar(255) binary NOT NULL default '',
   `val_timestamp` varchar(14) binary NOT NULL default '',