2003-04-14 23:10:40 +00:00
|
|
|
-- SQL to create the initial tables for the Wikipedia database.
|
|
|
|
|
-- This is read and executed by the install script; you should
|
|
|
|
|
-- never have to run it by itself.
|
|
|
|
|
--
|
2004-03-11 09:06:13 +00:00
|
|
|
-- Indexes should be defined here; please import the rest from indexes.sql.
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/user (
|
2003-04-14 23:10:40 +00:00
|
|
|
user_id int(5) unsigned NOT NULL auto_increment,
|
|
|
|
|
user_name varchar(255) binary NOT NULL default '',
|
2004-04-18 02:28:35 +00:00
|
|
|
user_real_name varchar(255) binary NOT NULL default '',
|
2003-04-14 23:10:40 +00:00
|
|
|
user_password tinyblob NOT NULL default '',
|
|
|
|
|
user_newpassword tinyblob NOT NULL default '',
|
|
|
|
|
user_email tinytext NOT NULL default '',
|
2004-12-18 03:47:11 +00:00
|
|
|
user_emailauthenticationtimestamp varchar(14) binary NOT NULL default '0',
|
2004-08-09 05:38:11 +00:00
|
|
|
user_options blob NOT NULL default '',
|
2003-04-14 23:10:40 +00:00
|
|
|
user_touched char(14) binary NOT NULL default '',
|
2004-09-26 11:17:34 +00:00
|
|
|
user_token char(32) binary NOT NULL default '',
|
2004-09-11 10:46:27 +00:00
|
|
|
PRIMARY KEY user_id (user_id),
|
|
|
|
|
INDEX user_name (user_name(10))
|
|
|
|
|
);
|
2004-08-09 05:38:11 +00:00
|
|
|
|
2004-09-11 10:46:27 +00:00
|
|
|
-- TODO: de-blob this; it should be a property table
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/user_rights (
|
2004-10-24 09:51:13 +00:00
|
|
|
ur_user int(5) unsigned NOT NULL,
|
2004-10-24 09:21:53 +00:00
|
|
|
ur_rights tinyblob NOT NULL default '',
|
2004-10-24 21:19:54 +00:00
|
|
|
UNIQUE KEY ur_user (ur_user)
|
2004-09-11 10:46:27 +00:00
|
|
|
);
|
2004-08-24 20:41:07 +00:00
|
|
|
|
2004-12-18 03:47:11 +00:00
|
|
|
-- The following table is no longer needed with Enotif >= 2.00
|
|
|
|
|
-- Entries for newtalk on user_talk page are handled like in the watchlist table
|
|
|
|
|
-- CREATE TABLE /*$wgDBprefix*/user_newtalk (
|
|
|
|
|
-- user_id int(5) NOT NULL default '0',
|
|
|
|
|
-- user_ip varchar(40) NOT NULL default '',
|
|
|
|
|
-- INDEX user_id (user_id),
|
|
|
|
|
-- INDEX user_ip (user_ip)
|
|
|
|
|
-- );
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-19 08:00:50 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/page (
|
2005-03-12 11:51:02 +00:00
|
|
|
-- Identifiers:
|
2004-12-19 08:00:50 +00:00
|
|
|
page_id int(8) unsigned NOT NULL auto_increment,
|
|
|
|
|
page_namespace tinyint NOT NULL,
|
|
|
|
|
page_title varchar(255) binary NOT NULL,
|
2005-03-12 11:51:02 +00:00
|
|
|
|
|
|
|
|
-- Mutable information
|
2004-12-19 08:00:50 +00:00
|
|
|
page_restrictions tinyblob NOT NULL default '',
|
|
|
|
|
page_counter bigint(20) unsigned NOT NULL default '0',
|
|
|
|
|
page_is_redirect tinyint(1) unsigned NOT NULL default '0',
|
|
|
|
|
page_is_new tinyint(1) unsigned NOT NULL default '0',
|
|
|
|
|
page_random real unsigned NOT NULL,
|
|
|
|
|
page_touched char(14) binary NOT NULL default '',
|
2005-03-12 11:51:02 +00:00
|
|
|
|
|
|
|
|
-- Handy key to revision.rev_id of the current revision
|
2004-12-19 08:00:50 +00:00
|
|
|
page_latest int(8) unsigned NOT NULL,
|
2005-03-12 11:51:02 +00:00
|
|
|
page_len int(8) unsigned NOT NULL,
|
2004-12-19 08:00:50 +00:00
|
|
|
|
|
|
|
|
PRIMARY KEY page_id (page_id),
|
|
|
|
|
UNIQUE INDEX name_title (page_namespace,page_title),
|
2005-03-12 11:51:02 +00:00
|
|
|
|
|
|
|
|
-- Special-purpose indexes
|
|
|
|
|
INDEX (page_random),
|
|
|
|
|
INDEX (page_len)
|
2004-12-19 08:00:50 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
CREATE TABLE /*$wgDBprefix*/revision (
|
|
|
|
|
rev_id int(8) unsigned NOT NULL auto_increment,
|
|
|
|
|
rev_page int(8) unsigned NOT NULL,
|
2005-03-28 10:47:12 +00:00
|
|
|
rev_text_id int(8) unsigned NOT NULL,
|
2004-12-19 08:00:50 +00:00
|
|
|
rev_comment tinyblob NOT NULL default '',
|
|
|
|
|
rev_user int(5) unsigned NOT NULL default '0',
|
|
|
|
|
rev_user_text varchar(255) binary NOT NULL default '',
|
|
|
|
|
rev_timestamp char(14) binary NOT NULL default '',
|
|
|
|
|
rev_minor_edit tinyint(1) unsigned NOT NULL default '0',
|
2005-03-31 11:40:05 +00:00
|
|
|
rev_deleted tinyint(1) unsigned NOT NULL default '0',
|
2004-09-11 10:46:27 +00:00
|
|
|
|
2004-12-19 08:00:50 +00:00
|
|
|
PRIMARY KEY rev_page_id (rev_page, rev_id),
|
|
|
|
|
UNIQUE INDEX rev_id (rev_id),
|
|
|
|
|
INDEX rev_timestamp (rev_timestamp),
|
2005-02-21 15:33:58 +00:00
|
|
|
INDEX page_timestamp (rev_page,rev_timestamp),
|
|
|
|
|
INDEX user_timestamp (rev_user,rev_timestamp),
|
|
|
|
|
INDEX usertext_timestamp (rev_user_text,rev_timestamp)
|
2004-09-11 10:46:27 +00:00
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-19 08:00:50 +00:00
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Holds text of individual page revisions.
|
|
|
|
|
--
|
|
|
|
|
CREATE TABLE /*$wgDBprefix*/text (
|
2003-04-14 23:10:40 +00:00
|
|
|
old_id int(8) unsigned NOT NULL auto_increment,
|
|
|
|
|
old_text mediumtext NOT NULL default '',
|
|
|
|
|
old_flags tinyblob NOT NULL default '',
|
2004-09-11 10:46:27 +00:00
|
|
|
|
2004-12-19 08:00:50 +00:00
|
|
|
PRIMARY KEY old_id (old_id)
|
2004-09-11 10:46:27 +00:00
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/archive (
|
2003-04-14 23:10:40 +00:00
|
|
|
ar_namespace tinyint(2) unsigned NOT NULL default '0',
|
|
|
|
|
ar_title varchar(255) binary NOT NULL default '',
|
|
|
|
|
ar_text mediumtext NOT NULL default '',
|
|
|
|
|
ar_comment tinyblob NOT NULL default '',
|
|
|
|
|
ar_user int(5) unsigned NOT NULL default '0',
|
|
|
|
|
ar_user_text varchar(255) binary NOT NULL,
|
|
|
|
|
ar_timestamp char(14) binary NOT NULL default '',
|
|
|
|
|
ar_minor_edit tinyint(1) NOT NULL default '0',
|
2004-09-11 10:46:27 +00:00
|
|
|
ar_flags tinyblob NOT NULL default '',
|
2005-03-12 08:06:46 +00:00
|
|
|
ar_rev_id int(8) unsigned,
|
2004-09-11 10:46:27 +00:00
|
|
|
|
|
|
|
|
KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp)
|
|
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-03-11 09:06:13 +00:00
|
|
|
--
|
|
|
|
|
-- Track links that do exist
|
|
|
|
|
-- l_from and l_to key to cur_id
|
|
|
|
|
--
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/links (
|
2004-03-11 09:06:13 +00:00
|
|
|
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),
|
|
|
|
|
KEY (l_to)
|
|
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-03-11 09:06:13 +00:00
|
|
|
--
|
|
|
|
|
-- Track links to pages that don't yet exist.
|
|
|
|
|
-- bl_from keys to cur_id
|
|
|
|
|
-- bl_to is a text link (namespace:title)
|
|
|
|
|
--
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/brokenlinks (
|
2003-04-14 23:10:40 +00:00
|
|
|
bl_from int(8) unsigned NOT NULL default '0',
|
2004-03-11 09:06:13 +00:00
|
|
|
bl_to varchar(255) binary NOT NULL default '',
|
|
|
|
|
UNIQUE KEY bl_from(bl_from,bl_to),
|
|
|
|
|
KEY (bl_to)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
--
|
|
|
|
|
-- Track links to images *used inline*
|
|
|
|
|
-- il_from keys to cur_id, il_to keys to image_name.
|
|
|
|
|
-- We don't distinguish live from broken links.
|
|
|
|
|
--
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/imagelinks (
|
2004-03-11 09:06:13 +00:00
|
|
|
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),
|
|
|
|
|
KEY (il_to)
|
|
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-05-15 00:29:39 +00:00
|
|
|
--
|
|
|
|
|
-- Track category inclusions *used inline*
|
|
|
|
|
-- cl_from keys to cur_id, cl_to keys to cur_title of the category page.
|
|
|
|
|
-- cl_sortkey is the title of the linking page or an optional override
|
|
|
|
|
-- cl_timestamp marks when the link was last added
|
|
|
|
|
--
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/categorylinks (
|
2004-05-15 00:29:39 +00:00
|
|
|
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 '',
|
|
|
|
|
cl_timestamp timestamp NOT NULL,
|
|
|
|
|
UNIQUE KEY cl_from(cl_from,cl_to),
|
|
|
|
|
KEY cl_sortkey(cl_to,cl_sortkey(128)),
|
|
|
|
|
KEY cl_timestamp(cl_to,cl_timestamp)
|
|
|
|
|
);
|
|
|
|
|
|
2004-03-11 09:06:13 +00:00
|
|
|
--
|
|
|
|
|
-- Stores (possibly gzipped) serialized objects with
|
|
|
|
|
-- cache arrays to reduce database load slurping up
|
|
|
|
|
-- from links and brokenlinks.
|
|
|
|
|
--
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/linkscc (
|
2003-11-08 15:32:28 +00:00
|
|
|
lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY,
|
|
|
|
|
lcc_cacheobj MEDIUMBLOB NOT NULL
|
2004-03-11 09:06:13 +00:00
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/site_stats (
|
2003-04-14 23:10:40 +00:00
|
|
|
ss_row_id int(8) unsigned NOT NULL,
|
|
|
|
|
ss_total_views bigint(20) unsigned default '0',
|
|
|
|
|
ss_total_edits bigint(20) unsigned default '0',
|
|
|
|
|
ss_good_articles bigint(20) unsigned default '0',
|
|
|
|
|
UNIQUE KEY ss_row_id (ss_row_id)
|
2004-03-11 09:06:13 +00:00
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/hitcounter (
|
2003-12-13 21:32:32 +00:00
|
|
|
hc_id INTEGER UNSIGNED NOT NULL
|
|
|
|
|
) TYPE=HEAP MAX_ROWS=25000;
|
|
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/ipblocks (
|
2003-09-07 13:56:25 +00:00
|
|
|
ipb_id int(8) NOT NULL auto_increment,
|
2003-04-14 23:10:40 +00:00
|
|
|
ipb_address varchar(40) binary NOT NULL default '',
|
|
|
|
|
ipb_user int(8) unsigned NOT NULL default '0',
|
|
|
|
|
ipb_by int(8) unsigned NOT NULL default '0',
|
|
|
|
|
ipb_reason tinyblob NOT NULL default '',
|
2003-09-07 13:56:25 +00:00
|
|
|
ipb_timestamp char(14) binary NOT NULL default '',
|
|
|
|
|
ipb_auto tinyint(1) NOT NULL default '0',
|
2004-02-14 12:37:25 +00:00
|
|
|
ipb_expiry char(14) binary NOT NULL default '',
|
2004-09-11 10:46:27 +00:00
|
|
|
|
|
|
|
|
PRIMARY KEY ipb_id (ipb_id),
|
|
|
|
|
INDEX ipb_address (ipb_address),
|
|
|
|
|
INDEX ipb_user (ipb_user)
|
|
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/image (
|
2003-04-14 23:10:40 +00:00
|
|
|
img_name varchar(255) binary NOT NULL default '',
|
|
|
|
|
img_size int(8) unsigned NOT NULL default '0',
|
2005-04-10 18:29:30 +00:00
|
|
|
img_width int(5) NOT NULL default '0',
|
|
|
|
|
img_height int(5) NOT NULL default '0',
|
2005-04-21 22:10:08 +00:00
|
|
|
img_metadata mediumblob NOT NULL,
|
2005-04-10 18:29:30 +00:00
|
|
|
img_bits int(3) NOT NULL default '0',
|
|
|
|
|
img_type int(3) NOT NULL default '0',
|
2003-04-14 23:10:40 +00:00
|
|
|
img_description tinyblob NOT NULL default '',
|
|
|
|
|
img_user int(5) unsigned NOT NULL default '0',
|
|
|
|
|
img_user_text varchar(255) binary NOT NULL default '',
|
2004-07-18 08:48:43 +00:00
|
|
|
img_timestamp char(14) binary NOT NULL default '',
|
2005-04-10 18:29:30 +00:00
|
|
|
|
2004-09-11 10:46:27 +00:00
|
|
|
PRIMARY KEY img_name (img_name),
|
|
|
|
|
INDEX img_size (img_size),
|
|
|
|
|
INDEX img_timestamp (img_timestamp)
|
|
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/oldimage (
|
2003-04-14 23:10:40 +00:00
|
|
|
oi_name varchar(255) binary NOT NULL default '',
|
|
|
|
|
oi_archive_name varchar(255) binary NOT NULL default '',
|
|
|
|
|
oi_size int(8) unsigned NOT NULL default 0,
|
2005-04-10 18:29:30 +00:00
|
|
|
oi_width int(5) NOT NULL default 0,
|
|
|
|
|
oi_height int(5) NOT NULL default 0,
|
|
|
|
|
oi_bits int(3) NOT NULL default 0,
|
|
|
|
|
oi_type int(3) NOT NULL default 0,
|
2003-04-14 23:10:40 +00:00
|
|
|
oi_description tinyblob NOT NULL default '',
|
|
|
|
|
oi_user int(5) unsigned NOT NULL default '0',
|
|
|
|
|
oi_user_text varchar(255) binary NOT NULL default '',
|
2004-09-11 10:46:27 +00:00
|
|
|
oi_timestamp char(14) binary NOT NULL default '',
|
2005-04-10 18:29:30 +00:00
|
|
|
|
2004-09-11 10:46:27 +00:00
|
|
|
INDEX oi_name (oi_name(10))
|
|
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/recentchanges (
|
2004-08-07 03:59:20 +00:00
|
|
|
rc_id int(8) NOT NULL auto_increment,
|
2003-04-14 23:10:40 +00:00
|
|
|
rc_timestamp varchar(14) binary NOT NULL default '',
|
|
|
|
|
rc_cur_time varchar(14) binary NOT NULL default '',
|
|
|
|
|
rc_user int(10) unsigned NOT NULL default '0',
|
|
|
|
|
rc_user_text varchar(255) binary NOT NULL default '',
|
2004-08-24 08:11:46 +00:00
|
|
|
rc_namespace tinyint(3) NOT NULL default '0',
|
2003-04-14 23:10:40 +00:00
|
|
|
rc_title varchar(255) binary NOT NULL default '',
|
|
|
|
|
rc_comment varchar(255) binary NOT NULL default '',
|
|
|
|
|
rc_minor tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
|
rc_bot tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
|
rc_new tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
|
rc_cur_id int(10) unsigned NOT NULL default '0',
|
|
|
|
|
rc_this_oldid int(10) unsigned NOT NULL default '0',
|
2004-01-17 05:49:39 +00:00
|
|
|
rc_last_oldid int(10) unsigned NOT NULL default '0',
|
|
|
|
|
rc_type tinyint(3) unsigned NOT NULL default '0',
|
|
|
|
|
rc_moved_to_ns tinyint(3) unsigned NOT NULL default '0',
|
2004-06-14 10:40:24 +00:00
|
|
|
rc_moved_to_title varchar(255) binary NOT NULL default '',
|
2004-08-09 05:38:11 +00:00
|
|
|
rc_patrolled tinyint(3) unsigned NOT NULL default '0',
|
2004-08-07 03:59:20 +00:00
|
|
|
rc_ip char(15) NOT NULL default '',
|
2004-09-11 10:46:27 +00:00
|
|
|
|
|
|
|
|
PRIMARY KEY rc_id (rc_id),
|
|
|
|
|
INDEX rc_timestamp (rc_timestamp),
|
|
|
|
|
INDEX rc_namespace_title (rc_namespace, rc_title),
|
|
|
|
|
INDEX rc_cur_id (rc_cur_id),
|
|
|
|
|
INDEX new_name_timestamp(rc_new,rc_namespace,rc_timestamp),
|
|
|
|
|
INDEX rc_ip (rc_ip)
|
|
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/watchlist (
|
2003-04-14 23:10:40 +00:00
|
|
|
wl_user int(5) unsigned NOT NULL,
|
|
|
|
|
wl_namespace tinyint(2) unsigned NOT NULL default '0',
|
|
|
|
|
wl_title varchar(255) binary NOT NULL default '',
|
2004-12-18 03:47:11 +00:00
|
|
|
wl_notificationtimestamp varchar(14) binary NOT NULL default '0',
|
2004-09-11 10:46:27 +00:00
|
|
|
UNIQUE KEY (wl_user, wl_namespace, wl_title),
|
|
|
|
|
KEY namespace_title (wl_namespace,wl_title)
|
|
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/math (
|
2003-05-02 22:55:37 +00:00
|
|
|
math_inputhash varchar(16) NOT NULL,
|
|
|
|
|
math_outputhash varchar(16) NOT NULL,
|
|
|
|
|
math_html_conservativeness tinyint(1) NOT NULL,
|
|
|
|
|
math_html text,
|
|
|
|
|
math_mathml text,
|
|
|
|
|
UNIQUE KEY math_inputhash (math_inputhash)
|
2004-03-11 09:06:13 +00:00
|
|
|
);
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2003-11-08 15:32:28 +00:00
|
|
|
|
2003-04-14 23:10:40 +00:00
|
|
|
-- Table searchindex must be MyISAM for fulltext support
|
|
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/searchindex (
|
2003-04-14 23:10:40 +00:00
|
|
|
si_page int(8) unsigned NOT NULL,
|
|
|
|
|
si_title varchar(255) NOT NULL default '',
|
|
|
|
|
si_text mediumtext NOT NULL default '',
|
2004-09-11 10:46:27 +00:00
|
|
|
UNIQUE KEY (si_page),
|
|
|
|
|
FULLTEXT si_title (si_title),
|
|
|
|
|
FULLTEXT si_text (si_text)
|
|
|
|
|
|
|
|
|
|
) TYPE=MyISAM;
|
2003-04-14 23:10:40 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/interwiki (
|
2003-08-21 11:20:38 +00:00
|
|
|
iw_prefix char(32) NOT NULL,
|
|
|
|
|
iw_url char(127) NOT NULL,
|
|
|
|
|
iw_local BOOL NOT NULL,
|
|
|
|
|
UNIQUE KEY iw_prefix (iw_prefix)
|
|
|
|
|
);
|
|
|
|
|
|
2004-05-09 01:30:34 +00:00
|
|
|
-- Used for caching expensive grouped queries
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/querycache (
|
2004-05-09 01:30:34 +00:00
|
|
|
qc_type char(32) NOT NULL,
|
|
|
|
|
qc_value int(5) unsigned NOT NULL default '0',
|
|
|
|
|
qc_namespace tinyint(2) unsigned NOT NULL default '0',
|
|
|
|
|
qc_title char(255) binary NOT NULL default '',
|
|
|
|
|
KEY (qc_type,qc_value)
|
|
|
|
|
);
|
2004-05-09 05:12:55 +00:00
|
|
|
|
|
|
|
|
-- For a few generic cache operations if not using Memcached
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/objectcache (
|
2004-05-09 05:12:55 +00:00
|
|
|
keyname char(255) binary not null default '',
|
|
|
|
|
value mediumblob,
|
|
|
|
|
exptime datetime,
|
|
|
|
|
unique key (keyname),
|
|
|
|
|
key (exptime)
|
|
|
|
|
);
|
2004-06-15 15:18:50 +00:00
|
|
|
|
|
|
|
|
-- For storing revision text
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/blobs (
|
2004-06-15 15:18:50 +00:00
|
|
|
blob_index char(255) binary NOT NULL default '',
|
|
|
|
|
blob_data longblob NOT NULL default '',
|
2004-06-21 20:22:59 +00:00
|
|
|
UNIQUE key blob_index (blob_index)
|
2004-06-15 15:18:50 +00:00
|
|
|
);
|
2004-07-18 20:45:28 +00:00
|
|
|
|
|
|
|
|
-- For article validation
|
|
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/validate (
|
2004-07-18 20:45:28 +00:00
|
|
|
`val_user` int(11) NOT NULL default '0',
|
2005-03-19 13:42:36 +00:00
|
|
|
`val_page` int(11) unsigned NOT NULL default '0',
|
|
|
|
|
`val_revision` int(11) unsigned NOT NULL default '0',
|
|
|
|
|
`val_type` int(11) unsigned NOT NULL default '0',
|
2004-07-18 20:45:28 +00:00
|
|
|
`val_value` int(11) default '0',
|
2004-07-19 17:21:11 +00:00
|
|
|
`val_comment` varchar(255) NOT NULL default '',
|
2005-03-19 13:42:36 +00:00
|
|
|
KEY `val_user` (`val_user`,`val_revision`)
|
|
|
|
|
) TYPE=MyISAM;
|
2004-08-24 08:11:46 +00:00
|
|
|
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/logging (
|
2004-08-24 08:11:46 +00:00
|
|
|
-- 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.
|
|
|
|
|
log_type char(10) NOT NULL default '',
|
|
|
|
|
log_action char(10) NOT NULL default '',
|
|
|
|
|
|
|
|
|
|
-- Timestamp. Duh.
|
|
|
|
|
log_timestamp char(14) NOT NULL default '19700101000000',
|
|
|
|
|
|
|
|
|
|
-- The user who performed this action; key to user_id
|
|
|
|
|
log_user int unsigned NOT NULL default 0,
|
|
|
|
|
|
|
|
|
|
-- Key to the page affected. Where a user is the target,
|
|
|
|
|
-- this will point to the user page.
|
|
|
|
|
log_namespace tinyint unsigned NOT NULL default 0,
|
2005-02-18 10:55:58 +00:00
|
|
|
log_title varchar(255) binary NOT NULL default '',
|
2004-08-24 08:11:46 +00:00
|
|
|
|
|
|
|
|
-- Freeform text. Interpreted as edit history comments.
|
|
|
|
|
log_comment varchar(255) NOT NULL default '',
|
|
|
|
|
|
2005-01-14 13:47:19 +00:00
|
|
|
-- LF separated list of miscellaneous parameters
|
|
|
|
|
log_params blob NOT NULL default '',
|
|
|
|
|
|
2004-08-24 08:11:46 +00:00
|
|
|
KEY type_time (log_type, log_timestamp),
|
|
|
|
|
KEY user_time (log_user, log_timestamp),
|
|
|
|
|
KEY page_time (log_namespace, log_title, log_timestamp)
|
|
|
|
|
);
|
2004-10-02 22:26:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Hold group name and description
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/`group` (
|
2004-10-02 22:26:00 +00:00
|
|
|
group_id int(5) unsigned NOT NULL auto_increment,
|
|
|
|
|
group_name varchar(50) NOT NULL default '',
|
|
|
|
|
group_description varchar(255) NOT NULL default '',
|
2004-10-24 22:20:52 +00:00
|
|
|
group_rights tinyblob,
|
2004-10-02 22:26:00 +00:00
|
|
|
PRIMARY KEY (group_id)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
-- Relation table between user and groups
|
2004-12-01 13:15:13 +00:00
|
|
|
CREATE TABLE /*$wgDBprefix*/user_groups (
|
2004-10-24 09:51:13 +00:00
|
|
|
ug_user int(5) unsigned NOT NULL default '0',
|
|
|
|
|
ug_group int(5) unsigned NOT NULL default '0',
|
|
|
|
|
PRIMARY KEY (ug_user,ug_group)
|
2004-10-02 22:26:00 +00:00
|
|
|
);
|