-- 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;
-- 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:
-- 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;
-- 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 '',
-- December 2003
--
-CREATE TABLE hitcounter (
+CREATE TABLE /*$wgDBprefix*/hitcounter (
hc_id INTEGER UNSIGNED NOT NULL
) TYPE=HEAP MAX_ROWS=25000;
-- 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);
-- 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);
-- 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);
-- 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,
-- 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
-- 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);
-- 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
-- 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);
-- 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),
-- 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),
-- 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),
-- 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
);
-- 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.
-- 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,
-- 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,
-- 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);
-- 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,
-- 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 '',
-- 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',
-- 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,
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 '',
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;
-- 2004-01-25
--
-ALTER TABLE recentchanges
+ALTER TABLE /*$wgDBprefix*/recentchanges
ADD INDEX new_name_timestamp(rc_new,rc_namespace,rc_timestamp);
-- 2004-08-09
--
-ALTER TABLE recentchanges
+ALTER TABLE /*$wgDBprefix*/recentchanges
ADD COLUMN rc_patrolled tinyint(3) unsigned NOT NULL default '0';
-- 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);
-- 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);
-- 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');
-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 '';
-- 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 '',
) 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;
-- 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;
-- 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),
- 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
-- 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;
-- 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 '',
);
-- 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)
--- 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),
) 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;
-- 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 '',