Manual:Database layout

The current schema for any version - with copious comments - can be found in the maintenance/tables.sql file. See the latest version from SVN. If using Postgres, the file maintenance/postgres/tables.sql should be viewed instead.

Proposed schema changes page contains the discussion for possible improvements to the database schema.

MediaWiki 1.10
Version 1.10 introduces the following tables:
 * page restrictions table

MediaWiki 1.9
Version 1.9 uses the following tables:
 * archive table
 * categorylinks table
 * externallinks table
 * filearchive table
 * hitcounter table
 * image table
 * imagelinks table
 * interwiki table
 * ipblocks table
 * job table
 * langlinks table
 * logging table
 * math table
 * objectcache table
 * oldimage table
 * page table
 * pagelinks table
 * querycache table
 * querycachetwo table
 * querycache info table - new
 * recentchanges table
 * redirect table - new
 * revision table
 * searchindex table
 * site_stats table
 * templatelinks table
 * text table
 * trackbacks table
 * transcache table
 * user table
 * user_groups table
 * user_newtalk table
 * watchlist table

MediaWiki 1.8
Version 1.8 uses the following tables:
 * archive table
 * categorylinks table
 * externallinks table
 * filearchive table - new
 * hitcounter table
 * image table
 * imagelinks table
 * interwiki table
 * ipblocks table
 * job table
 * langlinks table - new
 * logging table
 * math table
 * objectcache table
 * oldimage table
 * page table
 * pagelinks table
 * querycache table
 * querycache info table - new
 * recentchanges table
 * revision table
 * searchindex table
 * site_stats table
 * templatelinks table
 * text table
 * trackbacks table
 * transcache table - new
 * user table
 * user_groups table
 * user_newtalk table
 * watchlist table

MediaWiki 1.6-1.7
Version 1.6 uses the following tables :
 * archive table
 * categorylinks table
 * externallinks table - new
 * hitcounter table
 * image table
 * imagelinks table
 * interwiki table
 * ipblocks table
 * job table - new
 * logging table
 * math table
 * objectcache table
 * oldimage table
 * page table
 * pagelinks table
 * querycache table
 * recentchanges table
 * revision table
 * searchindex table
 * site_stats table
 * templatelinks table - new
 * text table
 * trackbacks table
 * user table
 * user_groups table
 * user_newtalk table
 * validate table
 * watchlist table

Tables in version 1.7 are different than in 1.6. Eg. user_table has no column user_rights. If you want to set privileges to user in mediawiki 1.7, you should go for user_groups table.

MediaWiki 1.5
Version 1.5 uses the following tables :
 * archive table
 * categorylinks table
 * hitcounter table
 * image table
 * imagelinks table
 * interwiki table
 * ipblocks table
 * logging table - new
 * math table
 * objectcache table
 * oldimage table
 * page table - new
 * pagelinks table - new
 * querycache table
 * recentchanges table
 * revision table - new
 * searchindex table
 * site_stats table
 * text table
 * trackbacks table - new
 * user table
 * user_groups table - new
 * user_newtalk table
 * validate table - new
 * watchlist table

MediaWiki 1.4
Version 1.4 uses the following tables:
 * archive table - "deleted" pages
 * blobs table
 * brokenlinks table - links in internal link style to non-existing pages in the same project (see below)
 * categorylinks table
 * cur table - current pages
 * hitcounter table
 * image table
 * imagelinks table tracks usage of images in wikipages (see below)
 * interwiki table
 * ipblocks table
 * links table - links in internal link style to existing pages in the same project (see below)
 * linkscc table - (see below)
 * math table
 * objectcache table
 * old table - old versions of pages
 * oldimage table
 * querycache table
 * recentchanges table
 * searchindex table
 * site_stats table
 * testac table
 * text table
 * user table
 * user_newtalk table
 * watchlist table

Data types
Data types used:
 * blob (binary) types :
 * tinyblob <= 255 bytes
 * blob <= 65,535 bytes
 * longblob <= 16,777,215 bytes
 * char(14), varchar(255)
 * numbers :
 * tinyint(1) unsigned
 * int(8) unsigned
 * int(11)
 * double unsigned