mediawiki

+-
ERD Image


Start a discussion

MySQL

mediawiki

Gravatar photo
Created by gracie
on 2009 Jun 09
Gravatar photo
Last Updated by gracie
on 2010 Feb 24
Brief Description

mediawiki 1.15.1
MediaWiki is the collaborative editing software that runs Wikipedia, the free encyclopedia, and other projects.
http://www.mediawiki.org

Tags

mediawiki mysql

Favorites          0 Followers
Viewed                855 times

Permalink

trunk_2

The archive table is the place where MediaWiki stores information on deleted pages. The pages may be restored, or undeleted, by MediaWiki, by using the deletion interface. Beginning in MediaWiki 1.5, the content of the pages remains in the text table; the deletion time is logged in the logging table.

ar_namespace

INT

Basic page information: contains the namespace of the deleted revision. These contain the value in page_namespace.

ar_title

VARCHAR

Basic page information: contains the page title of the deleted page, which is the same as page_title.

ar_text

MEDIUMBLOB

Not used; the revision text remains in the text table. Newly deleted pages will not store text in this table, but will rather reference the separately existing text rows. The behavior before MediaWiki 1.5 was different; old archived pages saved their text here, so this field remains for backward compatibility.
Note: Text may be gzipped or otherwise funky.

ar_comment

TINYBLOB

Basic revision information: contains the edit summary of the deleted revision, analogous to rev_comment.

ar_user

INT

Basic revision information: contains the user ID of the user who made the deleted revision; it is the same as user_id and rev_user. The value for this field is 0 for anonymous edits, initializations scripts, and for some mass imports.

ar_user_text

VARCHAR

Basic revision information: This field contains the text of the editor's username, or the IP address of the editor if the deleted revision was done by an unregistered user. Comparable to rev_user_text.

ar_timestamp

BINARY

This field contains the time at which the revision was originally saved. It is the equivalent of rev_timestamp.

Note: This is not the timestamp of article deletion; that is saved in the deletion log entry, in the logging table's log_timestamp.

ar_minor_edit

TINYINT

Basic revision information: Records whether the user marked the deleted revision as a minor edit. If the value for this field is 1, then the edit is tagged as 'minor'; it is 0 otherwise. This is equivalent to rev_minor_edit.

ar_flags

TINYBLOB

Similar to old_flags in the text table. Contains the following possible values:

gzip: Text is compressed with PHP's gzdeflate() function.

utf-8: Text was stored as UTF-8.
Note: If the $wgLegacyEncoding option is on, rows *without* this flag will be converted to UTF-8 transparently at load time.

object:Text field contained a serialized PHP object.
Note: The object either contains multiple versions compressed together to achieve a better compression ratio, or it refers to another row where the text can be found.

ar_rev_id

INT

When revisions are deleted, their unique rev_id is stored here so it can be retained after undeletion. This is necessary to retain permalinks to given revisions after accidental delete cycles or messy operations like history merges.

Note: Old entries from 1.4 will be NULL here, and a new rev_id will be created on undeletion for those revisions.

ar_text_id

INT

For revisions deleted in MediaWiki 1.5 and later, this is a key to old_id within the text table; that is, it is the key to the stored text in the storage backend. To avoid breaking the block-compression scheme and otherwise making storage changes harder, the actual text is *not* deleted from the text table; rather, the text is merely hidden by removal of the page and revision entries.

Note: Old entries deleted under MediaWiki 1.2-1.4 will have NULL values in this field, and their ar_text and ar_flags fields will be used to create a new text row upon undeletion.

ar_deleted

TINYINT

This field is reserved for future revisions to the deletion system. Equivalent to rev_deleted.

ar_len

INT

This field contains the length of the deleted revision, in bytes. Analogous to rev_len.

ar_page_id

INT

Reference to page_id. Useful for sysadmin fixing of large pages merged together in the archives, or for cleanly restoring a page at its original ID number if possible. Will be NULL for pages deleted prior to 1.11.

ar_parent_id

INT

The revision id of the previous revision to the page. Populated from rev_parent_id. Will be null for revisions deleted prior to 1.13.

Track all existing categories. Something is a category if 1) it has an entry somewhere in categorylinks, or 2) it once did. Categories might not have corresponding pages, so they need to be tracked separately.

cat_id

PKINT

Primary key

cat_title

VARCHAR

Name of the category, in the same form as page_title (with underscores). If there is a category page corresponding to this category, by definition, it has this name (in the Category namespace).

cat_pages

INT

Number of pages in the category

cat_subcats

INT

Number of sub-categories in the category

cat_files

INT

Number of files in the category

cat_hidden

TINYINT

Reserved for future use

Note: Information regarding which categories are hidden is stored in the page_props table.

Note: The number fields are signed to make underflow more obvious. We make the first number include the second two for better sorting: subtracting for display is easy, adding for ordering is not.

Note: If the information in this table is incorrect, run the maintenance script populateCategory.php, if neccessary with the --force option.

The categorylinks table stores entries on a page of the type [[category:abc]], which places the page into the category "abc" (for which an associated page may or may not exist). Links of the form [[:category:abc]] are not stored in categorylinks, but are handled as normal links. The editable parts of category pages are stored like other pages.

cl_from

INT

Stores the page_id of the article where the link was placed.

cl_to

VARCHAR

Stores the name (excluding namespace prefix) of the desired category.

cl_sortkey

VARCHAR

Stores the title by which the page should be sorted in a category list.

cl_timestamp

TIMESTAMP

Stores the time at which that link was last updated in the table.
There are three indexes which help improve performance:

The concatenation of cl_from and cl_to (for when an article is edited)

The concatenation of cl_to and the first 128 bytes of cl_sortkey (for displaying articles in order)

The concatenation of cl_to and cl_timestamp

The change_tag table tracks tags for revisions, logs and recent changes.

ct_rc_id

INT

ct_log_id

INT

ct_rev_id

INT

ct_tag

VARCHAR

ct_params

BLOB

The externallinks table is where MediaWiki stores and tracks external links. This table was introduced after 1.5.

The el_from is the page identifier of the referring wiki page. el_to is the actual URL itself and is passed to the browser, whilst el_index is the same URL search-optimised: username and password information is stripped, and the other components are reversed for faster searching, so http://user:password@sub.example.com/page.html becomes http://com.example.sub./page.html , which allows searches of the form 'Show all links pointing to *.example.com'.

el_from

INT

The el_from is the page identifier of the referring wiki page

el_to

BLOB

el_to is the actual URL itself and is passed to the browser

el_index

BLOB

el_index is the same URL search-optimised: username and password information is stripped

The filearchive table stores all the media that has been deleted, similar to the archive table's job for text. This is the table that makes image undeletion possible. Prior to MediaWiki 1.11, this was disabled per default, and Manual:$wgSaveDeletedFiles must be set to true to enable it. Since version 1.11, the behavior is controlled by $wgFileStore, and deleted files are per default stored in $wgUploadDirectory/deleted.
See also: Oldimage table

fa_id

PKINT

fa_name

VARCHAR

fa_archive_name

VARCHAR

fa_storage_group

VARBINARY

fa_storage_key

VARBINARY

fa_deleted_user

INT

fa_deleted_timestamp

BINARY

fa_deleted_reason

TEXT

fa_size

INT

fa_width

INT

fa_height

INT

fa_metadata

MEDIUMBLOB

fa_bits

INT

fa_media_type

ENUM

fa_major_mime

ENUM

fa_minor_mime

VARBINARY

fa_description

TINYBLOB

fa_user

INT

fa_user_text

VARCHAR

fa_timestamp

BINARY

fa_deleted

TINYINT

The hitcounter table in MediaWiki is a temporary buffer for storage of page view information. Depending on the value of the $wgHitcounterUpdateFreq setting, the table stores the page_id value of any pages that were visited in its hc_id field. The number in the setting is then fed into a randomizer, which then updates the page_counter fields of the stored pages when the random number is equal to a particular value.

This table was introduced in MediaWiki 1.3, and will always be empty if $wgDisableCounters is set to true.

hc_id

INT

Contains the page_id of each visited page in the buffer.

The image table describes images and other uploaded files. However, the image description pages are stored like other pages. See also: Manual:Image Administration.

img_name

PKVARCHAR

Filename.

img_size

INT

File size in bytes.

img_width

INT

img_height

INT

img_metadata

MEDIUMBLOB

img_bits

INT

img_media_type

ENUM

img_major_mime

ENUM

img_minor_mime

VARBINARY

img_description

TINYBLOB

Description field given during upload.

img_user

INT

User ID of who uploaded the file.

img_user_text

VARCHAR

User name of who uploaded the file.

img_timestamp

VARBINARY

Timestamp of when upload took place.

img_sha1

VARBINARY

The imagelinks table stores all the links to images. This is good for a variety of functions, from link caching in the output functions to the "what links here" page.

il_from

INT

is the page_id of the page the link is on.

il_to

VARCHAR

is the title of the file being linked to.

stores the interwiki prefixes with their targets.

iw_prefix

VARCHAR

is the prefix of the interwiki link; this is used the same way as a namespace is used when editing.

iw_url

BLOB

is the target of the link; the page name is substituted for $1.

iw_local

TINYINT

informs MediaWiki how it should treat interwiki links coming from external sources. If iw_local is 1, then it will treat these links as though they were generated from within the local wiki.

For example, the interwiki link fr: on the en.wikipedia.org project has iw_local=1 set. Therefore, the link to http://en.wikipedia.org/wiki/fr:Accueil gracefully redirects you to the French Homepage (Accueil). However, the Wikimedia foundation project site is flagged 0 on en.wikipedia.org; the link to http://en.wikipedia.org/wiki/wikimedia:Home does not work, even though [[wikimedia:Home]] would work if it were on a local Wikipedia page.

iw_trans

TINYINT

is used to allow transcluding templates (or other pages) from another MediaWiki installation. Both $wgEnableScaryTranscluding and iw_trans need to be on.

stores details of IP addresses and users who have been blocked from editing.

ipb_id

PKINT

Primary key, introduced for privacy.

ipb_address

TINYBLOB

Blocked IP address in dotted-quad form or user name.

ipb_user

INT

Blocked user ID or 0 for IP blocks.

ipb_by

INT

User ID of the administrator who made the block.

ipb_by_text

VARCHAR

Text username of the administrator who made the block.

ipb_reason

TINYBLOB

Reason for the block given by the administrator.

ipb_timestamp

BINARY

Creation (or refresh) date in standard YMDHMS form

ipb_auto

TINYINT

Indicates that the IP address was banned because a banned user accessed a page through it. If this is 1, ipb_address will be hidden.

ipb_anon_only

TINYINT

If set to 1, the block only applies to logged out users.

ipb_create_account

TINYINT

Prevents account creation from matching IP addresses.

ipb_enable_autoblock

TINYINT

Enables autoblock on the block.

ipb_expiry

VARBINARY

Expiry time set by the administrator at the time of the block.

ipb_range_start

TINYBLOB

The first IP in an IP range block.

ipb_range_end

TINYBLOB

The last IP in an IP range block.

ipb_deleted

TINYINT

Allows the entry to be flagged, hiding it from users and sysops.

ipb_block_email

TINYINT

Prevents the user from accessing Special:Emailuser

ipb_allow_usertalk

TINYINT

Prevents a blocked user from editing their talk page.

Jobs performed by parallel apache threads or a command-line daemon.

job_id

PKINT

job_cmd

VARBINARY

job_namespace

INT

job_title

VARCHAR

job_params

BLOB

langlinks table tracks interlanguage links.

This table is used for displaying pages, as a quick means to find the links that typically appear in the left margin, underneath the navigational and toolbox links. Without this table, MediaWiki would have to parse through the wikitext for each page display. (But it has to do this anyway, doesn't it?) The table has a primary key on page (ll_from) and target language (ll_lang), so each page can only store one link per language.

The table has three columns: ll_from (an integer), ll_lang (10 characters), ll_title (255 characters). If the wiki page "Sweden" contains the interlanguage link [[fr:Suède]], then ll_from will indicate the page Sweden where the link goes from, ll_lang will be "fr" and ll_title will be "Suède". In February 2009 for the Swedish language Wikipedia, this table has 3.2 million rows, of which 145,000 (4.5 %) have ll_lang "fr".

As a side effect of having this table, you can:
Find out which are the most popular target languages: select count(*), ll_lang from langlinks group by 2 order by 1 desc limit 20;
Find out which pages have the most interlanguage links: select count(*), ll_from from langlinks group by 2 order by 1 desc limit 20;
(But then you would need to translate ll_from into useful page names.)
Interlanguage link statistics are included in the monthly Wikipedia statistics.

Note:
Interlanguage links are often referred to as interwiki links. For example, interlanguage links are updated by so-called "interwiki bots". While this table can have millions of rows, the interwiki table typically only has a few hundred.
ll_title is a single varchar string, to be used in the URL on the target language wiki. This table alone is not sufficient to determine if that link is unique, since it could lead to a redirect or a namespace alias. For example, the interlanguage links [[fr:Catégorie:Suède]] and [[fr:Category:Suède]] are synonymous even though the namespace is spelled differently.

ll_from

INT

ll_lang

VARBINARY

ll_title

VARCHAR

Every log action in MediaWiki is logged in the logging table. Users can see those edits on Special:Log, with the exception of a few restricted logs (like Special:Log/suppress).

The contents of this table is what you see on the Special:Log page.
Example:
14:18, 25 June 2008 Jacksprat (Talk | contribs| block) uploaded "Image:Climb.jpg" (Added this image for the climbing page)

log_id

PKINT

primary key for the table.

log_type

VARBINARY

The type of the log action, or the "log type". You can filter by this type on Special:Log. Typical values are: block, delete, import, makebot, move, newusers, protect, renameuser, rights, upload ("uploaded" in example)

log_action

VARBINARY

The action performed. There may be multiple actions possible for a given type: for example, an entry with the type delete may have the action delete or restore, etc. Values are (as of 19 June 2009):

log_timestamp

BINARY

the time the action was performed, in the timestamp format MediaWiki uses everywhere in the database: yyyymmddhhmmss ("14:18, 25 June 2008" in example)

log_user

INT

the id of the user who performed the action. This is a reference into the user table (the user id of "Jacksprat" in example)

log_namespace

INT

the namespace of the affected page. Together with log_title, this is a reference into the page table ("Image:Climb.jpg" in example)

Note: logging table may contain rows with log_namespace < 0:
Special:Renameuser with log_type and log_action being either "" or "renameuser"
Special:Userlogin with log_type and log_action being "newusers"

log_title

VARCHAR

the title of the affected page. Together with log_namespace, this is a reference into the page table

log_comment

VARCHAR

the comment given for the action; that is the upload comment for uploads, the deletion comment for deletions, etc

log_params

BLOB

additional parameters, usually empty. For user blocks, this contains the duration of the block, in human readable form. For page moves, this contains the location the page was moved to.

log_deleted

TINYINT

math table is used by the math module to keep track of previously-rendered items.

math_inputhash

VARBINARY

math_outputhash

VARBINARY

math_html_conservativeness

TINYINT

math_html

TEXT

math_mathml

TEXT

Objectcache table is used for a few generic cache operations if not using Memcached.

keyname

PKVARBINARY

value

MEDIUMBLOB

exptime

DATETIME

This table holds information about old revisions of images. It will be filled when one uploads a new version of an existing image to the wiki. These images are moved to the folder /image/archive.
See also: Filearchive table

oi_name

VARCHAR

name of the image (file and article, seems to be the same)

oi_archive_name

VARCHAR

name of the image, prefixed by a timestamp of the time where it became an old revision

oi_size

INT

oi_width

INT

oi_height

INT

oi_bits

INT

oi_description

TINYBLOB

oi_user

INT

oi_user_text

VARCHAR

name of original uploader

oi_timestamp

BINARY

timestamp of original file upload

oi_metadata

MEDIUMBLOB

oi_media_type

ENUM

oi_major_mime

ENUM

oi_minor_mime

VARBINARY

oi_deleted

TINYINT

oi_sha1

VARBINARY

The page table can be considered the "core of the wiki". Each page in a MediaWiki installation has an entry here which identifies it by title and contains some essential metadata. It was first introduced in r6710, in MediaWiki 1.5.

The text of the page itself is stored in the text table. To retrieve the text of an article, MediaWiki first searches for page_title in this table. Then, page_latest is used to search the revision table for rev_id, and rev_text_id is obtained in the process. The value obtained for rev_text_id is used to search for old_id in the text table to retrieve the text.

Note: If you want to completely delete a page manually from the database, be sure to delete the entry for the page in the page table, and for all the page's revisions in the revision table, and all of the text rows corresponding only to the page in the text table. This can be done by deleting the page row, then running maintenance/deleteOrphanedRevisions.php.

page_id

PKINT

Uniquely identifying primary key. This value is preserved across edits and renames, but not deletion and recreation. For example, for this page, page_id = 10501. [1][2]

page_namespace

INT

A page name is broken into a namespace and a title. The namespace keys are UI-language-independent constants, defined in includes/Defines.php.
This field contains the number of the page's namespace. The values range from 0 to 15 for the standard namespaces, and from 100 to 255 for custom namespaces.

page_title

VARCHAR

The sanitized page title, without the title of its namespace. It is stored as text, with spaces replaced by underscores.

page_restrictions

TINYBLOB

Comma-separated set of permission keys indicating who can move or edit the page.

Note: Beginning with MediaWiki 1.10, page protection controls were moved to the page restrictions table.

page_counter

BIGINT

Number of times this page has been viewed. Note that on some sites (e.g. Wikimedia sites) incrementing this field is disabled so as to increase performance - see the $wgDisableCounters global.

page_is_redirect

TINYINT

A value of 1 here indicates the article is a redirect; it is 0 in all other cases.

page_is_new

TINYINT

This field stores whether the page is a new entry or not; if the field contains a value of 1, then it indicates that the page is a new entry with only one edit. It is 0 in all other cases.

page_random

DOUBLE UNSIGNED

Random decimal value, between 0 and 1, used for Special:Randompage.

page_touched

BINARY

This timestamp is updated whenever the page changes in a way requiring it to be re-rendered, invalidating caches. Aside from editing this includes permission changes, creation or deletion of linked pages, and alteration of contained templates.

page_latest

INT

This is a foreign key to rev_id for the current revision. It may be 0 during page creation.

page_len

INT

Uncompressed length in bytes of the page's current source text.

Contains properties about pages, currently only used with __HIDDENCAT__ magic word.

pp_page

INT

pp_propname

VARBINARY

pp_value

BLOB

The page_restrictions table is used to store page protection levels in MediaWiki 1.10 and later. The most notable feature is the introduction of cascading page protections for high-visibility pages.
This table was introduced in MediaWiki 1.10 (r19095–r19703), and overrides the page_restrictions field in the page table.

pr_page

INT

This field contains a reference to page_id, which works as the foreign key for this table.

pr_type

VARBINARY

The type of protection (whether it applies to edits, page moves, or similar) is stored in this field.

pr_level

VARBINARY

This column describes the level of protection for the page; full protection for sysop-only pages, semi-protection for autoconfirmed users, or any other levels.

pr_cascade

TINYINT

This field determines whether cascading protection (meaning that all transcluded templates and images on the page will be protected as well).

pr_user

INT

This field is reserved to support a future per-user edit restriction system.

pr_expiry

VARBINARY

This field contains the timestamp for pages whose protection has a set expiration date, and has a format similar to the expiry time in the Ipblocks table. Rows that contain a null value in this column are considered to be protected indefinitely.

pr_id

PKINT

This is the primary key for the table, and is used to identify a particular row in the table.

Tracks all internal links in the Wiki. Each entry contains the source page's ID, and the namespace (number) and article name (in text) that is being linked to within that source page. There may be many instances of the source page's ID, as many as the internal links within it, but there can be only one entry per internal link for any page ID (or MYSQL will yell out a fatal error).
Note that the target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.[1]

pl_from

INT

pl_namespace

INT

pl_title

VARCHAR

Contains protection of non-existant pages, the list of protected pages can be found at Special:Protectedtitles.

pt_namespace

INT

pt_title

VARCHAR

pt_user

INT

pt_reason

TINYBLOB

pt_timestamp

BINARY

pt_expiry

VARBINARY

pt_create_perm

VARBINARY

Table used for caching expensive grouped queries.

qc_type

VARBINARY

qc_value

INT

qc_namespace

INT

qc_title

VARCHAR

querycache_info table contains details of updates to cached special pages.

qci_type

VARBINARY

qci_timestamp

BINARY

querycachetwo is a table used for caching expensive grouped queries that need two links (for example double-redirects).

qcc_type

VARBINARY

qcc_value

INT

qcc_namespace

INT

qcc_title

VARCHAR

qcc_namespacetwo

INT

qcc_titletwo

VARCHAR

The recentchanges table contains information about the latest modifications done to the wiki (not older than $wgRCMaxAge; see also below). The contents of this table are used to generate the recent changes pages, related changes pages, watchlists, and the list of new pages, and contain information such as editors' IP addresses not found on other tables.

rc_id

PKINT

This is the primary key for the table. (Introduced in MediaWiki 1.5)

rc_timestamp

VARBINARY

Holds the timestamp of the edit.

rc_cur_time

VARBINARY

Held for backwards compatibility, although still used in a few places.

rc_user

INT

This is equal to the user_id of the user who made this edit. The value for this field is 0 for anonymous edits, initialization scripts, and for some mass imports.

rc_user_text

VARCHAR

This fields holds the text of the editor's username, or the IP address of the editor if the revision was done by an unregistered user.

rc_namespace

INT

The namespace number of the page that was modified.
If this row describes a logged action, this field has a value of -1 (NS_SPECIAL), as it records an entry for a Special:Log subpage. This is the only place in which Special: pages are directly recorded in database namespace/title pairs at present.

rc_title

VARCHAR

The name of the page that was modified, with the namespace stripped. This field stores information in text form.

rc_comment

VARCHAR

This field holds an editor's edit summary (editor's comment on revision). This text is shown in the recent changes, related changes, watchlists, and, in the case of page creation, the list of new pages. (The revision table contains a copy used for the history and user contributions pages.) It is rendered in a subset of wiki markup.

rc_minor

TINYINT

Records whether the user marked the 'minor edit' checkbox. If the value for this field is 1, then the edit was declared as 'minor'; it is 0 otherwise. Many automated edits are marked as minor.

rc_bot

TINYINT

Records whether the edit was made by a 'bot account'. If the value for this field is 1, then the edit was made by a 'bot' (i.e. a user with the 'bot' permission); it is 0 otherwise. It is possible for bots to avoid setting this flag on their edits by including the parameter "bot=0" in the edit form submission. Also, users with the 'rollback' and 'markbotedits' permissions may retroactively mark their rollbacks and the edits being rolled back as bot edits by including the parameter "bot=1" in the rollback link.

rc_new

TINYINT

If the value for this field is 1, then this edit created a page; it is 0 otherwise.

rc_cur_id

INT

This field links to the page_id key in the page table, which stores the metadata of the page.

rc_this_oldid

INT

Links to the rev_id key of the new page revision (after the edit occurs) in the revision table.

rc_last_oldid

INT

Links to rev_id of the revision prior to this edit, which included the previous content of the page.

rc_type

TINYINT

Probably incomplete
This field stores the type of modification that was made to a page:
0 - edit of existing page
1 - new page
3 - log action (introduced in MediaWiki 1.2)

rc_moved_to_ns

TINYINT

This field stored the namespace of a page whenever it was moved. As of MediaWiki 1.8, it remains on the table for backwards compatibility only, and always has the value 0.

rc_moved_to_title

VARCHAR

This field stored the new page title of a page whenever it was moved. As of MediaWiki 1.8, it remains on the table for backwards compatibility only, and is always a null string.

rc_patrolled

TINYINT

If the Recent Changes Patrol option ($wgUseRCPatrol) is enabled, users may mark edits as having been reviewed to remove a warning flag on the RC list. A value of 1 indicates the page has been reviewed. (Introduced in MediaWiki 1.4)

rc_ip

VARBINARY

This field stores the IP address of the user specified on rc_user if $wgPutIPinRC is enabled. This field is used to generate CheckUser reports, as this information is not stored anywhere else on MediaWiki's database architecture. (Introduced in MediaWiki 1.3)

rc_old_len

INT

This field stores the size, in bytes, of previous revision's text. This field is used to generate the added and removed characters feature in recent changes, related changes and watchlists.

rc_new_len

INT

This field stores the size, in bytes, of the current revision's text. This field is used to generate the added and removed characters feature in recent changes, related changes and watchlists.

rc_deleted

TINYINT

This field stores a value for this particular revision's visibility within the wiki. It was created to accommodate upcoming revisions to the deletion system. The field is analogous to rev_deleted.

rc_logid

INT

This field is a foreign key to the logging table, which links to log_id if this row corresponds to a log entry. The field was introduced in MediaWiki 1.10.

rc_log_type

VARBINARY

If a log action is referenced in this row, this field stores the type of log action that was performed, and which is referenced in this row. Typical values are block, delete, import, makebot, move, newusers, protect, renameuser, rights, upload. This field is comparable to log_type.

rc_log_action

VARBINARY

If a log action is referenced in this row, this field stores the type of log action that was performed, and which is referenced in this row. This field is comparable to log_action.

rc_params

BLOB

This field will be a mirror of log_params, following the log_params text rewrite. Introduced in MediaWiki 1.10.

Contains for each page that is currently a redirect (i.e., not for old revisions which are redirects) the id of the source page, the target namespace number, and the target page title without namespace.
The target page may or may not exist.
NOTE: as of August 2007, database dumps for Wikipedia and other Wikimedia projects as provided on http://download.wikimedia.org/ have incomplete data in this table: only redirect pages that have been created or edited recently are present. For older redirects, resort to using the pagelinks table.

rd_from

PKINT

rd_namespace

INT

rd_title

VARCHAR

The revision table holds metadata for every edit done to a page within the wiki. Every edit of a page creates a revision row, which holds information such as the user who made the edit, the time at which the edit was made, and a reference to the new wikitext in the text table.

Note that a row is partly about the edit operation and partly about the result of that operation, the new wikitext. It does not give a reference to the old wikitext.

Import of the last revision of a page from another wiki produces two entries in the revision table, one with the date and wikitext of the imported revision, and one with the import date. The wikitext of the latter, which becomes that of the current page, is, if a page with the same name already existed, that of the more recent of the two pages.

The revision table is very similar to the recentchanges table. The revision table is used for page history and user contributions listings. The recentchanges table is used for recent changes, related changes, watchlists, and, in the case of page creation, for the list of new pages.

Differences include:
The recentchanges table also references the previous revision of the page
The recentchanges table also records logged events such as page moves and deletions
Items in the recentchanges table are periodically purged; those in the revision table are typically kept longer or indefinitely.
as said, import of a page revision not only adds an entry to the revision table with the import date, but also one with the original date.

rev_id

PKINT

This field holds the primary key for each revision.

rev_page

INT

This field holds a reference to the page to which this revision pertains. The number in this field is equal to the page_id field of said page. This should never be invalid.

rev_text_id

INT

This is a pointer to old_id in the text table, where the actual bulk text is stored. It's possible for multiple revisions to use the same text—for instance, revisions where only metadata is altered, or where a rollback is done to a previous version.

rev_comment

TINYBLOB

This field holds an editor's edit summary (editor's comment on revision). This text is shown in the history and contributions. (The recentchanges table contains a copy used for recent changes, related changes, watchlists, and, in the case of page creation, for the list of new pages.) It is rendered in a sanitized subset of wiki markup.

rev_user

INT

This is equal to the user_id of the user who made this edit. The value for this field is 0 for anonymous edits, initializations scripts, and for some mass imports.

rev_user_text

VARCHAR

This field holds the text of the editor's username, or the IP address of the editor if the revision was done by an unregistered user.

rev_timestamp

BINARY

Holds the timestamp of the edit.

rev_minor_edit

TINYINT

Records whether the user marked the 'minor edit' checkbox. If the value for this field is 1, then the edit was declared as 'minor'; it is 0 otherwise. Many automated edits are marked as minor.

rev_deleted

TINYINT

This field is reserved for the new RevisionDelete system.

rev_len

INT

This field contains the length of the revision, in bytes. Used in history pages.

rev_parent_id

INT

This field is used to add support for a tree structure (The Adjacency List Model).

The searchindex table is used to provide full text searches. Those can only be done with the MyISAM table type and the text table (cur table in 1.4 and earlier) uses the InnoDB type to improve concurrency, so a copy is required. If using Postgres, this table does not exist: the full text information is stored as columns in the page and pagecontent tables directly.

si_page

INT

page ID from cur.

si_title

VARCHAR

page title from cur.

si_text

MEDIUMTEXT

the indexed text from cur.

Contains a single row with some aggregate info on the state of the site.

ss_row_id

INT

ss_total_views

BIGINT

ss_total_edits

BIGINT

ss_good_articles

BIGINT

ss_total_pages

BIGINT

ss_users

BIGINT

ss_active_users

BIGINT

ss_admins

INT

ss_images

INT

The tag_summary is used to pull a LIST of tags simply without ugly GROUP_CONCAT that only works on MySQL 4.1+

ts_rc_id

INT

ts_log_id

INT

ts_rev_id

INT

ts_tags

BLOB

Contains for each current page inclusion the id of the host page, the namespace number of the included page, and its title without namespace.
The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.[1]
MediaWiki version: 1.6
New to version 1.6.

tl_from

INT

tl_namespace

INT

tl_title

VARCHAR

The text table holds the wikitext of individual page revisions. If using Postgres, this table is named pagecontent.
Field names are a holdover from the 'old' revisions table in MediaWiki 1.4 and earlier.

old_id

PKINT

revision.rev_text_id in revision table is a key to this column. (In MediaWiki 1.5+, archive.ar_text_id is also a key to this column.)

old_text

MEDIUMBLOB

The wikitext of the page.

old_flags

TINYBLOB

Comma-separated list of flags. Contains the following possible values:

tb_id

PKINT

tb_page

INT

tb_title

VARCHAR

tb_url

BLOB

tb_ex

TEXT

tb_name

VARCHAR

Cache of interwiki transclusion.

tc_url

VARBINARY

tc_contents

TEXT

tc_time

INT

A table to log updates, one text key row per update.

ul_key

PKVARCHAR

The user table is where MediaWiki stores information about users. If using Postgres, this table is named mwuser.

user_id

PKINT

is the primary key, used to uniquely identify a user

user_name

VARCHAR

Usernames must be unique, and must not be in the form of an IP address. Shouldn't allow slashes or case conflicts. Spaces are allowed, and are not converted to underscores like titles. (Conflicts?)

user_real_name

VARCHAR

stores the user's real name (optional) as provided by the user in their "Preferences" section.

user_password

TINYBLOB

user_password is one of two formats, depending on the setting of $wgPasswordSalt:
If $wgPasswordSalt is true (default) it it a concatenation of:
The string ":B:",
A pseudo-random hexadecimal 31-bit salt between 0x0 and 0x7fff ffff (inclusive),
The colon character (":"), and
The MD5 hash of a concatenation of the salt, a dash ("-"), and the MD5 hash of the password.
If $wgPasswordSalt is false, it it a concatenation of:
The string ":A:" and
The MD5 hash of the password.

user_newpassword

TINYBLOB

is generated for the mail-a-new-password feature.

user_newpass_time

BINARY

user_email

TINYTEXT

Note: email should be restricted, not public info. Same with passwords. ;)

user_options

BLOB

is a newline-separated list of name=value pairs.

user_touched

BINARY

the last time a user made a change on the site, including logins, changes to pages (any namespace), watchlistings, and preference changes.

user_token

BINARY

a pseudorandomly generated value that is stored in a cookie when the "remember password" feature is used

user_email_authenticated

BINARY

user_email_token

BINARY

user_email_token_expires

BINARY

user_registration

BINARY

user_editcount

INT

Count of edits and edit-like actions.
*NOT* intended to be an accurate copy of COUNT(*) WHERE rev_user=user_id May contain NULL for old accounts if batch-update scripts haven't been run, as well as listing deleted edits and other myriad ways it could be out of sync.
Meant primarily for heuristic checks to give an impression of whether the account has been used much.

The user groups table maps the users in a particular MediaWiki installation to their corresponding user rights. Each group can be assigned a mixture of permissions through LocalSettings.php or via extensions; all users of a particular group have those permissions granted to them as a result of their membership in the group. As the table is separate from the user table, this allows for the creation of a shared user database with permissions that vary from wiki to wiki within a wiki farm. This table was introduced on r5648, in MediaWiki 1.5.

All unregistered users belong to the '*' only; all registered users are automatically part of the 'user' group. User groups are additive; as a result, all registered users have all the privileges assigned to the '*' group as well.

Note: If you are using 1.3 or 1.4, have a look at setting user rights in MediaWiki in Meta. Before MediaWiki 1.5, the user table contained a user_rights field for this purpose.

ug_user

INT

This field links to a given user's user_id. It is a foreign key used to link accounts with their assigned privileges.

ug_group

VARBINARY

This field stores the user's permissions, which are stored as groups. At runtime, $wgGroupPermissions will associate group keys with particular permissions; a user will have the combined permissions of any group they're explicitly in, plus the implicit '*' and 'user' groups.

table stores notifications of user talk page changes, for the display of the "you have new messages" box.

user_id

INT

Key to user.user_id

user_ip

VARBINARY

If the user is an anonymous user their IP address is stored here since the user_id of 0 is ambiguous

user_last_timestamp

BINARY

The valid_tag contains a list of defined tags, to be used by Special:Tags.

vt_tag

PKVARCHAR

The watchlist table contains for each registered user his or her id and for all the pages the user watches, the namespace number, the page title without namespace, and a notification timestamp, used for page change notification.

wl_user

INT

wl_namespace

INT

wl_title

VARCHAR

wl_notificationtimestamp

VARBINARY