"comment":"The \"actor\" table associates user names or IP addresses with integers for the benefit of other tables that need to refer to either logged-in or logged-out users. If something can only ever be done by logged-in users, it can refer to the user table directly.",
"comment":"Stores the groups the user has once belonged to. The user may still belong to these groups (check user_groups). Autopromotion of users to groups from which they were removed can be restricted by using wgAutopromoteOnce instead of wgAutopromote.",
"comment":"Edits, blocks, and other actions typically have a textual comment describing the action. They are stored here to reduce the size of the main tables, and to allow for deduplication. Deduplication is currently best-effort to avoid locking on inserts that would be required for strict deduplication. There MAY be multiple rows with the same comment_text and comment_data.",
"comment":"Hash of comment_text and comment_data, for deduplication",
"type":"integer",
"options":{"notnull":true}
},
{
"name":"comment_text",
"comment":"Text comment summarizing the change. This text is shown in the history and other changes lists, rendered in a subset of wiki markup by Linker::formatComment(). Size limits are enforced at the application level, and should take care to crop UTF-8 strings appropriately.",
"type":"blob",
"options":{"length":65535,"notnull":true}
},
{
"name":"comment_data",
"comment":"JSON data, intended for localizing auto-generated comments. This holds structured data that is intended to be used to provide localized versions of automatically-generated comments. When not empty, comment_text should be the generated comment localized using the wiki's content language.",
"comment":"Slots represent an n:m relation between revisions and content objects. A content object can have a specific \"role\" in one or more revisions. Each revision can have multiple content objects, each having a different role.",
"columns":[
{
"name":"slot_revision_id",
"comment":"reference to rev_id or ar_rev_id",
"type":"bigint",
"options":{"unsigned":true,"notnull":true}
},
{
"name":"slot_role_id",
"comment":"reference to role_id",
"type":"smallint",
"options":{"unsigned":true,"notnull":true}
},
{
"name":"slot_content_id",
"comment":"reference to content_id",
"type":"bigint",
"options":{"unsigned":true,"notnull":true}
},
{
"name":"slot_origin",
"comment":"The revision ID of the revision that originated the slot's content. To find revisions that changed slots, look for slot_origin = slot_revision_id. TODO: Is that actually true? Rollback seems to violate it by setting slot_origin to an older rev_id. Undeletions could result in the same situation.",
"comment":"User preferences and perhaps other fun stuff. :) Replaces the old user.user_options blob, with a couple nice properties: 1) We only store non-default settings, so changes to the defaults are now reflected for everybody, not just new accounts. 2) We can more easily do bulk lookups, statistics, or modifications of saved options since it's a sane table structure.",
"columns":[
{
"name":"up_user",
"comment":"Foreign key to user.user_id",
"type":"integer",
"options":{"unsigned":true,"notnull":true}
},
{
"name":"up_property",
"comment":"Name of the option being saved. This is indexed for bulk lookup.",
"comment":"The content table represents content objects. It's primary purpose is to provide the necessary meta-data for loading and interpreting a serialized data blob to create a content object.",
"comment":"Nominal size of the content object (not necessarily of the serialized blob)",
"type":"integer",
"options":{"notnull":true,"unsigned":true}
},
{
"name":"content_sha1",
"comment":"Nominal hash of the content object (not necessarily of the serialized blob)",
"type":"binary",
"options":{"notnull":true,"length":32}
},
{
"name":"content_model",
"comment":"reference to model_id. Note the content format isn't specified; it should be assumed to be in the default format for the model unless auto-detected otherwise.",
"comment":"Table caching which local files a module depends on that aren't registered directly, used for fast retrieval of file dependency. Currently only used for tracking images that CSS depends on",
"columns":[
{
"name":"md_module",
"comment":"Module name",
"type":"binary",
"options":{"notnull":true,"length":255}
},
{
"name":"md_skin",
"comment":"Module context vary (includes skin and language; called \"md_skin\" for legacy reasons)",
"comment":"For each redirect, this table contains exactly one row defining its target.\nRedirect targets are key to page_namespace/page_title of the target page.\nThe target page may or may not exist, and due to renames\nand deletions may refer to different page records as time\ngoes by.",
"columns":[
{
"name":"rd_from",
"comment":"Key to the page_id of the redirect page",
"comment":"Track page-to-page hyperlinks within the wiki. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.",
"columns":[
{
"name":"pl_from",
"comment":"Key to the page_id of the page containing the link.",
"comment":"Track template inclusions. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.",
"columns":[
{
"name":"tl_from",
"comment":"Key to the page_id of the page containing the link.",
"comment":"Track links to images *used inline* We don't distinguish live from broken links here, so they do not need to be changed on upload/removal.",
"columns":[
{
"name":"il_from",
"comment":"Key to page_id of the page containing the image / media link.",
"comment":"Track all existing categories. Something is a category if 1) it has an entry somewhere in categorylinks, or 2) it has a description page. Categories might not have corresponding pages, so they need to be tracked separately. The numbers of member pages (including categories and media), subcategories, and Image: namespace members, respectively are included in this table too. These 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.",
"comment":"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).",
"comment":"User permissions have been broken out to a separate table; this allows sites with a shared user table to have different permissions assigned to a user in each project. This table replaces the old user_rights field which used a comma-separated blob.",
"comment":"Group names are short symbolic string keys. The set of group names is open-ended, though in practice only some predefined ones are likely to be used. 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.",
"comment":"Timestamp used to send notification e-mails and show 'updated since last visit' markers. Set to NULL when the user visits the latest revision of the page, which means that they should be sent an e-mail on the next change.",
"comment":"Global identifier for the site, ie 'enwiktionary'",
"options":{"notnull":true,"length":64}
},
{
"name":"site_type",
"type":"binary",
"comment":"Type of the site, ie 'mediawiki'",
"options":{"notnull":true,"length":32}
},
{
"name":"site_group",
"type":"binary",
"comment":"Group of the site, ie 'wikipedia'",
"options":{"notnull":true,"length":32}
},
{
"name":"site_source",
"type":"binary",
"comment":"Source of the site data, ie 'local', 'wikidata', 'my-magical-repo'",
"options":{"notnull":true,"length":32}
},
{
"name":"site_language",
"type":"binary",
"comment":"Language code of the sites primary language.",
"options":{"notnull":true,"length":35}
},
{
"name":"site_protocol",
"type":"binary",
"comment":"Protocol of the site, ie 'http://', 'irc://', '//'. This field is an index for lookups and is build from type specific data in site_data.",
"options":{"notnull":true,"length":32}
},
{
"name":"site_domain",
"type":"string",
"comment":"Domain of the site in reverse order, ie 'org.mediawiki.www.'. This field is an index for lookups and is build from type specific data in site_data.",
"options":{"notnull":true,"length":255}
},
{
"name":"site_data",
"type":"blob",
"comment":"Type dependent site data.",
"options":{"notnull":true,"length":65530}
},
{
"name":"site_forward",
"type":"mwtinyint",
"comment":"If site.tld/path/key:pageTitle should forward users to the page on the actual site, where \"key\" is the local identifier.",
"options":{"notnull":true,"length":1}
},
{
"name":"site_config",
"type":"blob",
"comment":"Type dependent site config. For instance if template transclusion should be allowed if it's a MediaWiki.",
"comment":"The interwiki prefix, (e.g. \"Meatball\", or the language prefix \"de\")",
"options":{"length":32,"notnull":true}
},
{
"name":"iw_url",
"type":"blob",
"comment":"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.",
"options":{"notnull":true,"length":65530}
},
{
"name":"iw_api",
"type":"blob",
"comment":"The URL of the file api.php",
"options":{"notnull":true,"length":65530}
},
{
"name":"iw_wikiid",
"type":"string",
"comment":"The name of the database (for a connection to be established with LBFactory::getMainLB( 'wikiid' ))",
"options":{"notnull":true,"length":64}
},
{
"name":"iw_local",
"type":"mwtinyint",
"comment":"A boolean value indicating whether the wiki is in this project (used, for example, to detect redirect loops)",
"options":{"notnull":true,"length":1}
},
{
"name":"iw_trans",
"type":"mwtinyint",
"comment":"Boolean value indicating whether interwiki transclusions are allowed.",
"comment":"In the case of HTTP URLs, this is the URL with any username or password removed, and with the labels in the hostname reversed and converted to lower case which will allow faster searching for all pages with WHERE clause. Note: If PHP's intl extension is enabled/disabled, maintenance/refreshExternallinksIndex.php needs to be run to refresh this field",
"options":{"length":65530,"notnull":true}
},
{
"name":"el_index_60",
"type":"binary",
"comment":"'el_index' truncated to 60 bytes to allow for sortable queries that aren't supported by a partial index",
"comment":"Every time an edit by a logged out user is saved, a row is created in ip_changes. This stores the IP as a hex representation so that we can more easily find edits within an IP range.",
"columns":[
{
"name":"ipc_rev_id",
"comment":"Foreign key to the revision table, also serves as the unique primary key",
"comment":"Hex representation of the IP address, as returned by Wikimedia\\IPUtils::toHex() For IPv4 it will resemble: ABCD1234 For IPv6: v6-ABCD1234000000000000000000000000 BETWEEN is then used to identify revisions within a given range",
"comment":"Temporary table to avoid blocking on an alter of revision. On large wikis like the English Wikipedia, altering the revision table is a months-long process. This table is being created to avoid such an alter, and will be merged back into revision in the future",
"comment":"Temporary table to avoid blocking on an alter of revision. On large wikis like the English Wikipedia, altering the revision table is a months-long process. This table is being created to avoid such an alter, and will be merged back into revision in the future",
"comment":"A binary string obtained by applying a sortkey generation algorithm (Collation::getSortKey()) to page_title, or cl_sortkey_prefix . \"\\n\" page_title if cl_sortkey_prefix is nonempty.",
"comment":"A prefix for the raw sortkey manually specified by the user, either via [[Category:Foo|prefix]] or {{defaultsort:prefix}}. If nonempty, it's concatenated with a line break followed by the page title before the sortkey conversion algorithm is run. We store this so that we can update collations without reparsing all pages. Note: If you change the length of this field, you also need to change code in LinksUpdate.php. See T27254.",
"comment":"Stores $wgCategoryCollation at the time cl_sortkey was generated. This can be used to install new collation versions, tracking which rows are not yet updated. '' means no collation, this is a legacy row that needs to be updated by updateCollation.php. In the future, it might be possible to specify different collations per category.",
"comment":"Stores whether cl_from is a category, file, or other page, so we can paginate the three categories separately. This only has to be updated when moving pages into or out of the category namespace, since file pages cannot be moved to other namespaces, nor can non-files be moved into the file namespace.",
"type":"mwenum",
"options":{"notnull":true,"default":"page",
"CustomSchemaOptions":{
"enum_values":["page","subcat","file"]
}
}
}
],
"indexes":[
{
"name":"cl_sortkey",
"comment":"We always sort within a given category, and within a given type. FIXME: Formerly this index didn't cover cl_type (since that didn't exist), so old callers won't be using an index: fix this?",
"comment":"Original base filename; key to image.img_name, page.page_title, etc",
"type":"binary",
"options":{
"notnull":true,
"default":"",
"length":255
}
},
{
"name":"fa_archive_name",
"comment":"Filename of archived file, if an old revision",
"type":"binary",
"options":{
"notnull":false,
"default":"",
"length":255
}
},
{
"name":"fa_storage_group",
"comment":"Which storage bin (directory tree or object store) the file data is stored in. Should be 'deleted' for files that have been deleted; any other bin is not yet in use.",
"type":"binary",
"options":{
"notnull":false,
"length":16
}
},
{
"name":"fa_storage_key",
"comment":"SHA-1 of the file contents plus extension, used as a key for storage. eg 8f8a562add37052a1848ff7771a2c515db94baa9.jpg. If NULL, the file was missing at deletion time or has been purged from the archival storage.",
"comment":"Holds text of individual page revisions. Field names are a holdover from the 'old' revisions table in MediaWiki 1.4 and earlier: an upgrade will transform that table into the 'text' table to minimize unnecessary churning and downtime. If upgrading, the other fields will be left unused.",
"columns":[
{
"name":"old_id",
"comment":"Unique text storage key number. Note that the 'oldid' parameter used in URLs does *not* refer to this number anymore, but to rev_id. content.content_address refers to this column",
"type":"integer",
"options":{
"autoincrement":true,
"unsigned":true,
"notnull":true
}
},
{
"name":"old_text",
"comment":"Depending on the contents of the old_flags field, the text may be convenient plain text, or it may be funkily encoded.",
"type":"blob",
"options":{
"notnull":true,
"length":16777215
}
},
{
"name":"old_flags",
"comment":"Comma-separated list of flags:\n* gzip: text is compressed with PHP's gzdeflate() function.\n* utf-8: text was stored as UTF-8. If $wgLegacyEncoding option is on, rows *without* this flag will be converted to UTF-8 transparently at load time. Note that due to a bug in a maintenance script, this flag may have been stored as 'utf8' in some cases (T18841).\n* object: text field contained a serialized PHP object. 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.\n* external: text was stored in an external location specified by old_text. Any additional flags apply to the data stored at that URL, not the URL itself. The 'object' flag is *not* set for URLs of the form 'DB://cluster/id/itemid', because the external storage system itself decompresses these.",
"comment":"Blocks against user accounts, IP addresses and IP ranges.",
"columns":[
{
"name":"ipb_id",
"comment":"Primary key, introduced for privacy.",
"type":"integer",
"options":{
"autoincrement":true,
"notnull":true
}
},
{
"name":"ipb_address",
"comment":"Blocked IP address in dotted-quad form or user name.",
"type":"blob",
"options":{
"notnull":true,
"length":255
}
},
{
"name":"ipb_user",
"comment":"Blocked user ID or 0 for IP blocks.",
"type":"integer",
"options":{
"unsigned":true,
"notnull":true,
"default":0
}
},
{
"name":"ipb_by_actor",
"comment":"Actor who made the block.",
"type":"bigint",
"options":{
"unsigned":true,
"notnull":true
}
},
{
"name":"ipb_reason_id",
"comment":"Key to comment_id. Text comment made by blocker.",
"type":"bigint",
"options":{
"unsigned":true,
"notnull":true
}
},
{
"name":"ipb_timestamp",
"comment":"Creation (or refresh) date in standard YMDHMS form. IP blocks expire automatically.",
"type":"mwtimestamp",
"options":{
"notnull":true
}
},
{
"name":"ipb_auto",
"comment":"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, and the block identified by block ID number.",
"type":"mwtinyint",
"options":{
"notnull":true,
"length":1,
"default":0
}
},
{
"name":"ipb_anon_only",
"comment":"If set to 1, block applies only to logged-out users",
"type":"mwtinyint",
"options":{
"notnull":true,
"length":1,
"default":0
}
},
{
"name":"ipb_create_account",
"comment":"Block prevents account creation from matching IP addresses",
"type":"mwtinyint",
"options":{
"notnull":true,
"length":1,
"default":1
}
},
{
"name":"ipb_enable_autoblock",
"comment":"Block triggers autoblocks",
"type":"mwtinyint",
"options":{
"notnull":true,
"length":1,
"default":1
}
},
{
"name":"ipb_expiry",
"comment":"Time at which the block will expire. May be \"infinity\"",
"type":"mwtimestamp",
"options":{
"notnull":true,
"CustomSchemaOptions":{
"allowInfinite":true
}
}
},
{
"name":"ipb_range_start",
"comment":"Start of an address range, in hexadecimal size chosen to allow IPv6. FIXME: this field were originally blank for single-IP blocks, but now it's populated. No migration was ever done. It should be fixed to be blank again for such blocks (T51504).",
"type":"blob",
"options":{
"notnull":true,
"length":255
}
},
{
"name":"ipb_range_end",
"comment":"End of an address range, in hexadecimal size chosen to allow IPv6. FIXME: this field were originally blank for single-IP blocks, but now it's populated. No migration was ever done. It should be fixed to be blank again for such blocks (T51504).",
"type":"blob",
"options":{
"notnull":true,
"length":255
}
},
{
"name":"ipb_deleted",
"comment":"Flag for entries hidden from users and Sysops",
"type":"mwtinyint",
"options":{
"notnull":true,
"length":1,
"default":0
}
},
{
"name":"ipb_block_email",
"comment":"Block prevents user from accessing Special:Emailuser",
"type":"mwtinyint",
"options":{
"notnull":true,
"length":1,
"default":0
}
},
{
"name":"ipb_allow_usertalk",
"comment":"Block allows user to edit their own talk page",
"type":"mwtinyint",
"options":{
"notnull":true,
"length":1,
"default":0
}
},
{
"name":"ipb_parent_block_id",
"comment":"ID of the block that caused this block to exist. Autoblocks set this to the original block so that the original block being deleted also deletes the autoblocks",
"type":"integer",
"options":{
"notnull":false,
"default":null
}
},
{
"name":"ipb_sitewide",
"comment":"Block user from editing any page on the site (other than their own user talk page).",
"type":"mwtinyint",
"options":{
"notnull":true,
"length":1,
"default":1
}
}
],
"indexes":[
{
"name":"ipb_address_unique",
"comment":"Unique index to support \"user already blocked\" messages. Any new options which prevent collisions should be included",
"columns":[
"ipb_address",
"ipb_user",
"ipb_auto"
],
"unique":true,
"options":{"lengths":[255,null,null]}
},
{
"name":"ipb_user",
"comment":"For querying whether a logged-in user is blocked",
"columns":[
"ipb_user"
],
"unique":false
},
{
"name":"ipb_range",
"comment":"For querying whether an IP address is in any range",
"columns":[
"ipb_range_start",
"ipb_range_end"
],
"unique":false,
"options":{"lengths":[8,8]}
},
{
"name":"ipb_timestamp",
"comment":"Index for Special:BlockList",
"columns":[
"ipb_timestamp"
],
"unique":false
},
{
"name":"ipb_expiry",
"comment":"Index for table pruning",
"columns":[
"ipb_expiry"
],
"unique":false
},
{
"name":"ipb_parent_block_id",
"comment":"Index for removing autoblocks when a parent block is removed",
"comment":"major part of a MIME media type as defined by IANA see https://www.iana.org/assignments/media-types/ for \"chemical\" cf. http://dx.doi.org/10.1021/ci9803233 by the ACS",
"comment":"minor part of a MIME media type as defined by IANA the minor parts are not required to adhere to any standard but should be consistent throughout the database see https://www.iana.org/assignments/media-types/",
"type":"binary",
"options":{
"notnull":true,
"default":"unknown",
"length":100
}
},
{
"name":"img_description_id",
"comment":"Foreign key to comment table, which contains the description field as entered by the uploader. This is displayed in image upload history and logs.",
"type":"bigint",
"options":{
"unsigned":true,
"notnull":true
}
},
{
"name":"img_actor",
"comment":"actor_id of the uploader.",
"type":"bigint",
"options":{
"unsigned":true,
"notnull":true
}
},
{
"name":"img_timestamp",
"comment":"Time of the upload.",
"type":"mwtimestamp",
"options":{
"notnull":true,
"length":14
}
},
{
"name":"img_sha1",
"comment":"SHA-1 content hash in base-36",
"type":"binary",
"options":{
"notnull":true,
"default":"",
"length":32
}
}
],
"indexes":[
{
"name":"img_actor_timestamp",
"comment":"Used by Special:Newimages and ApiQueryAllImages",
"columns":[
"img_actor",
"img_timestamp"
],
"unique":false
},
{
"name":"img_size",
"comment":"Used by Special:ListFiles for sort-by-size",
"columns":[
"img_size"
],
"unique":false
},
{
"name":"img_timestamp",
"comment":"Used by Special:Newimages and Special:ListFiles",