* Updates
[lhc/web/wiklou.git] / maintenance / tables.sql
index c83d58a..c326536 100644 (file)
@@ -130,7 +130,7 @@ CREATE TABLE /*$wgDBprefix*/user (
   UNIQUE INDEX user_name (user_name),
   INDEX (user_email_token)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- User permissions have been broken out to a separate table;
@@ -156,20 +156,20 @@ CREATE TABLE /*$wgDBprefix*/user_groups (
   
   PRIMARY KEY (ug_user,ug_group),
   KEY (ug_group)
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 -- Stores notifications of user talk page changes, for the display
 -- of the "you have new messages" box
 CREATE TABLE /*$wgDBprefix*/user_newtalk (
   -- Key to user.user_id
   user_id int(5) NOT NULL default '0',
-  -- If the user is an anonymous user hir IP address is stored here
+  -- If the user is an anonymous user their IP address is stored here
   -- since the user_id of 0 is ambiguous
   user_ip varchar(40) NOT NULL default '',
   INDEX user_id (user_id),
   INDEX user_ip (user_ip)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 
 --
@@ -229,7 +229,7 @@ CREATE TABLE /*$wgDBprefix*/page (
   INDEX (page_random),
   INDEX (page_len)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Every edit of a page creates also a revision row.
@@ -284,7 +284,7 @@ CREATE TABLE /*$wgDBprefix*/revision (
   INDEX user_timestamp (rev_user,rev_timestamp),
   INDEX usertext_timestamp (rev_user_text,rev_timestamp)
 
-) TYPE=InnoDB MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
+) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024;
 -- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit
 
 --
@@ -320,7 +320,7 @@ CREATE TABLE /*$wgDBprefix*/text (
   
   PRIMARY KEY old_id (old_id)
 
-) TYPE=InnoDB MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;
+) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;
 -- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit
 
 --
@@ -373,10 +373,13 @@ CREATE TABLE /*$wgDBprefix*/archive (
 
   -- rev_deleted for archives
   ar_deleted tinyint(1) unsigned NOT NULL default '0',
+
+  -- Length of this revision in bytes
+  ar_len int(8) unsigned,
   
   KEY name_title_timestamp (ar_namespace,ar_title,ar_timestamp)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 
 --
@@ -396,7 +399,7 @@ CREATE TABLE /*$wgDBprefix*/pagelinks (
   UNIQUE KEY pl_from (pl_from,pl_namespace,pl_title),
   KEY (pl_namespace,pl_title,pl_from)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 
 --
@@ -416,7 +419,7 @@ CREATE TABLE /*$wgDBprefix*/templatelinks (
   UNIQUE KEY tl_from (tl_from,tl_namespace,tl_title),
   KEY (tl_namespace,tl_title,tl_from)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Track links to images *used inline*
@@ -435,7 +438,7 @@ CREATE TABLE /*$wgDBprefix*/imagelinks (
   UNIQUE KEY il_from (il_from,il_to),
   KEY (il_to,il_from)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Track category inclusions *used inline*
@@ -475,7 +478,7 @@ CREATE TABLE /*$wgDBprefix*/categorylinks (
   -- Not really used?
   KEY cl_timestamp (cl_to,cl_timestamp)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Track links to external URLs
@@ -503,7 +506,7 @@ CREATE TABLE /*$wgDBprefix*/externallinks (
   KEY (el_from, el_to(40)),
   KEY (el_to(60), el_from),
   KEY (el_index(60))
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 -- 
 -- Track interlanguage links
@@ -520,7 +523,7 @@ CREATE TABLE /*$wgDBprefix*/langlinks (
 
   UNIQUE KEY (ll_from, ll_lang),
   KEY (ll_lang, ll_title)
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Contains a single row with some aggregate info
@@ -557,7 +560,7 @@ CREATE TABLE /*$wgDBprefix*/site_stats (
 
   UNIQUE KEY ss_row_id (ss_row_id)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Stores an ID for every time any article is visited;
@@ -619,6 +622,9 @@ CREATE TABLE /*$wgDBprefix*/ipblocks (
 
   -- Flag for entries hidden from users and Sysops
   ipb_deleted bool NOT NULL default 0,
+
+  -- Block prevents user from accessing Special:Emailuser
+  ipb_block_email bool NOT NULL default 0,
   
   PRIMARY KEY ipb_id (ipb_id),
 
@@ -631,7 +637,7 @@ CREATE TABLE /*$wgDBprefix*/ipblocks (
   INDEX ipb_timestamp (ipb_timestamp),
   INDEX ipb_expiry (ipb_expiry)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 
 --
@@ -688,7 +694,7 @@ CREATE TABLE /*$wgDBprefix*/image (
   -- Used by Special:Newimages and Special:Imagelist
   INDEX img_timestamp (img_timestamp)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Previous revisions of uploaded files.
@@ -713,9 +719,16 @@ CREATE TABLE /*$wgDBprefix*/oldimage (
   oi_user_text varchar(255) binary NOT NULL,
   oi_timestamp char(14) binary NOT NULL default '',
 
-  INDEX oi_name (oi_name(10))
+  oi_metadata mediumblob NOT NULL,
+  oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
+  oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
+  oi_minor_mime varchar(32) NOT NULL default "unknown",
+  oi_deleted tinyint(1) unsigned NOT NULL default '0',
+  
+  INDEX oi_name_timestamp (oi_name,oi_timestamp),
+  INDEX oi_name_archive_name (oi_name,oi_archive_name)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Record of deleted file data
@@ -770,7 +783,7 @@ CREATE TABLE /*$wgDBprefix*/filearchive (
   INDEX (fa_deleted_timestamp),              -- sort by deletion time
   INDEX (fa_deleted_user)                    -- sort by deleter
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Primarily a summary table for Special:Recentchanges,
@@ -853,7 +866,7 @@ CREATE TABLE /*$wgDBprefix*/recentchanges (
   INDEX rc_ns_usertext (rc_namespace, rc_user_text),
   INDEX rc_user_text (rc_user_text, rc_timestamp)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 CREATE TABLE /*$wgDBprefix*/watchlist (
   -- Key to user.user_id
@@ -872,7 +885,7 @@ CREATE TABLE /*$wgDBprefix*/watchlist (
   UNIQUE KEY (wl_user, wl_namespace, wl_title),
   KEY namespace_title (wl_namespace, wl_title)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 
 --
@@ -898,7 +911,7 @@ CREATE TABLE /*$wgDBprefix*/math (
   
   UNIQUE KEY math_inputhash (math_inputhash)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- When using the default MySQL search backend, page titles
@@ -934,7 +947,7 @@ CREATE TABLE /*$wgDBprefix*/interwiki (
   -- The URL of the wiki, with "$1" as a placeholder for an article name.
   -- Any spaces in the name will be transformed to underscores before
   -- insertion.
-  iw_url char(127) NOT NULL,
+  iw_url varchar(127) NOT NULL,
   
   -- A boolean value indicating whether the wiki is in this project
   -- (used, for example, to detect redirect loops)
@@ -945,37 +958,37 @@ CREATE TABLE /*$wgDBprefix*/interwiki (
   
   UNIQUE KEY iw_prefix (iw_prefix)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Used for caching expensive grouped queries
 --
 CREATE TABLE /*$wgDBprefix*/querycache (
   -- A key name, generally the base name of of the special page.
-  qc_type char(32) NOT NULL,
+  qc_type varchar(32) binary NOT NULL,
   
   -- Some sort of stored value. Sizes, counts...
   qc_value int(5) unsigned NOT NULL default '0',
   
   -- Target namespace+title
   qc_namespace int NOT NULL default '0',
-  qc_title char(255) binary NOT NULL default '',
+  qc_title varchar(255) binary NOT NULL default '',
   
   KEY (qc_type,qc_value)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- For a few generic cache operations if not using Memcached
 --
 CREATE TABLE /*$wgDBprefix*/objectcache (
-  keyname char(255) binary NOT NULL default '',
+  keyname varchar(255) binary NOT NULL default '',
   value mediumblob,
   exptime datetime,
   UNIQUE KEY (keyname),
   KEY (exptime)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 --
 -- Cache of interwiki transclusion
@@ -985,7 +998,7 @@ CREATE TABLE /*$wgDBprefix*/transcache (
   tc_contents text,
   tc_time int NOT NULL,
   UNIQUE INDEX tc_url_idx (tc_url)
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 CREATE TABLE /*$wgDBprefix*/logging (
   -- Symbolic keys for the general log type and the action type
@@ -1012,7 +1025,7 @@ CREATE TABLE /*$wgDBprefix*/logging (
   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,
+  log_id int unsigned NOT NULL auto_increment,
 
   -- rev_deleted for logs
   log_deleted tinyint(1) unsigned NOT NULL default '0',
@@ -1023,7 +1036,7 @@ CREATE TABLE /*$wgDBprefix*/logging (
   KEY page_time (log_namespace, log_title, log_timestamp),
   KEY times (log_timestamp)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 CREATE TABLE /*$wgDBprefix*/trackbacks (
   tb_id int auto_increment,
@@ -1035,7 +1048,7 @@ CREATE TABLE /*$wgDBprefix*/trackbacks (
 
   PRIMARY KEY (tb_id),
   INDEX (tb_page)
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 
 -- Jobs performed by parallel apache threads or a command-line daemon
@@ -1056,7 +1069,7 @@ CREATE TABLE /*$wgDBprefix*/job (
 
   PRIMARY KEY job_id (job_id),
   KEY (job_cmd, job_namespace, job_title)
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 
 -- Details of updates to cached special pages
@@ -1071,7 +1084,7 @@ CREATE TABLE /*$wgDBprefix*/querycache_info (
 
   UNIQUE KEY ( qci_type )
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 -- For each redirect, this table contains exactly one row defining its target
 CREATE TABLE /*$wgDBprefix*/redirect (
@@ -1087,31 +1100,31 @@ CREATE TABLE /*$wgDBprefix*/redirect (
 
   PRIMARY KEY rd_from (rd_from),
   KEY rd_ns_title (rd_namespace,rd_title,rd_from)
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 -- Used for caching expensive grouped queries that need two links (for example double-redirects)
 CREATE TABLE /*$wgDBprefix*/querycachetwo (
   -- A key name, generally the base name of of the special page.
-  qcc_type char(32) NOT NULL,
+  qcc_type varchar(32) NOT NULL,
   
   -- Some sort of stored value. Sizes, counts...
   qcc_value int(5) unsigned NOT NULL default '0',
   
   -- Target namespace+title
   qcc_namespace int NOT NULL default '0',
-  qcc_title char(255) binary NOT NULL default '',
+  qcc_title varchar(255) binary NOT NULL default '',
   
   -- Target namespace+title2
   qcc_namespacetwo int NOT NULL default '0',
-  qcc_titletwo char(255) binary NOT NULL default '',
+  qcc_titletwo varchar(255) binary NOT NULL default '',
 
   KEY qcc_type (qcc_type,qcc_value),
   KEY qcc_title (qcc_type,qcc_namespace,qcc_title),
   KEY qcc_titletwo (qcc_type,qcc_namespacetwo,qcc_titletwo)
 
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
---- Used for storing page restrictions (i.e. protection levels)
+-- Used for storing page restrictions (i.e. protection levels)
 CREATE TABLE /*$wgDBprefix*/page_restrictions (
   -- Page to apply restrictions to (Foreign Key to page).
   pr_page int(8) NOT NULL,
@@ -1126,15 +1139,15 @@ CREATE TABLE /*$wgDBprefix*/page_restrictions (
   -- 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,
+  pr_id int unsigned NOT NULL auto_increment,
 
   PRIMARY KEY pr_pagetype (pr_page,pr_type),
 
-  UNIQUE KEY  pr_id (pr_id),
+  UNIQUE KEY pr_id (pr_id),
   KEY pr_page (pr_page),
   KEY pr_typelevel (pr_type,pr_level),
   KEY pr_level (pr_level),
   KEY pr_cascade (pr_cascade)
-) TYPE=InnoDB;
+) /*$wgDBTableOptions*/;
 
 -- vim: sw=2 sts=2 et