Manual:Database layout - MediaWiki
Jump to content
From mediawiki.org
Translate this page
Languages:
Bahasa Indonesia
català
dansk
lietuvių
magyar
polski
português
português do Brasil
slovenčina
čeština
русский
українська
العربية
فارسی
ગુજરાતી
ไทย
中文
Schema
redirects here; for information about the
Schema:
namespace, see
Extension:EventLogging
, and for the structure of
extension.json
, see
Manual:Extension.json/Schema
Manual:Contents
MediaWiki database layout
database_layout table
Database schema diagram of MediaWiki
Explore database schema →
The SQL code that creates the
MySQL/MariaDB
core tables for any MediaWiki version is in the
sql/tables.json
source file, which is then transformed into platform-specific SQL files, like
sql/mysql/tables-generated.sql
for MySQL.
Prior to MediaWiki 1.35, the SQL code that created the core tables for any MediaWiki version—with extensive comments—was in the
maintenance/tables.sql
source file.
Up to MediaWiki 1.37
maintenance/tables.sql
continued to be partially in use as some tables hadn't been migrated to
maintenance/tables.json
yet.
In MediaWiki 1.44, the schema files were moved to a new top-level
sql
directory.
The most important tables are probably:
page
revision
text
actor
user
Version history
The following table depicts the range of MediaWiki versions over which each table has existed in the schema.
Red rows
indicate tables that are no longer used by the core nor added by the installer as of a particular version.
They might however still be used by extensions. Note, table headings are repeated every 10 rows for clarity.
Compatibility matrix with MediaWiki versions
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
actor
archive
block
block_
target
blobs
bot_
passwords
broken
links
category
category
links
change_
tag
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
change_
tag_
def
collation
comment
content
content_
models
cur
external
links
external_
user
file
file
archive
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
filerevision
filetypes
hit
counter
image
image
links
image_
comment_
temp
interwiki
ip_changes
ipblocks
ipblocks_
old
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
ipblocks_
restrictions
iwlinks
job
l10n_
cache
langlinks
links
linkscc
linktarget
logging
log_
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
math
module_
deps
msg_
resource
msg_
resource_
links
object
cache
old
oldimage
page
pagelinks
page_
props
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
page_
restrictions
profiling
protected_
titles
querycache
querycachetwo
querycache_
info
recentchanges
redirect
revision
revision_
actor_
temp
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
revision_
comment_
temp
searchindex
sites
site_
identifiers
site_
stats
slots
slot_
roles
tag_
summary
templatelinks
text
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
trackbacks
transcache
updatelog
uploadstash
user
user_
autocreate_
serial
user_
former_
groups
user_
groups
user_
newtalk
user_
properties
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
user_
rights
valid_
tag
validate
watchlist
watchlist_expiry
1.1
1.2
1.3
1.4
1.5
1.6
1.7
1.8
1.9
1.10
1.11
1.12
1.13
1.14
1.15
1.16
1.17
1.18
1.19
1.20
1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28
1.29
1.30
1.31
1.32
1.33
1.34
1.35
1.36
1.37
1.38
1.39
1.40
1.41
1.42
1.43
1.44
1.45
master
Database management systems
In MediaWiki master, tables.sql has been migrated to
sql/tables.json
, and documenting comments should be found there instead of the resultant SQL files.
See the latest MariaDB/MySQL-compatible versions from Git:
sql/mysql/tables-generated.sql
If using
SQLite
, the file
sql/sqlite/tables-generated.sql
should be viewed instead.
If using
PostgreSQL
, the files
sql/postgres/tables.sql
and
sql/postgres/tables-generated.sql
should be viewed instead.
If using
Microsoft SQL Server
, see
maintenance/mssql/tables.sql
(removed in 1.34)
If using
Oracle
, see
maintenance/oracle/tables.sql
(removed in 1.34)
See also
Manual:Database access
Database field prefixes
w:Wikipedia:Database queries
Developer hub
Records of edits in the database
Research on MediaWiki DB schema evolution
Diagram instructions
, documents how to update the diagram
Diagrams
commons:Category:MediaWiki database schemas
, for MediaWiki 1.10 (2007) - MediaWiki 1.28 (2017)
1.34.0
1.35.0
1.36.0
1.37.0
1.38.0
1.39.0
1.40.0
1.41.0
1.42.1
1.43.0
1.44.0
1.45.0
Databases
Engines
Current
MariaDB
MySQL
PostgreSQL
SQLite
Former
Oracle
SQL Server
Technical documentation
Schema
tables
API property associations
Field prefixes
Primary key storage in other fields
Wikimedia extension tables
Inconsistencies
Configuration
Settings
Sharing
Development
Access
Optimisation
Policy
Updater
Extension schema updates
Schema changes
Core tables
Current
actor
archive
block
block_target
bot_passwords
category
categorylinks
change_tag
change_tag_def
collation
comment
content
content_models
existencelinks
externallinks
file
filearchive
filerevision
filetypes
image
imagelinks
interwiki
iwlinks
ipblocks_restrictions
ip_changes
job
l10n_cache
langlinks
linktarget
logging
log_search
objectcache
oldimage
page
pagelinks
page_props
page_restrictions
protected_titles
querycache
querycachetwo
querycache_info
recentchanges
redirect
revision
searchindex
sites
site_identifiers
site_stats
slots
slot_roles
templatelinks
text
updatelog
uploadstash
user
user_autocreate_serial
user_former_groups
user_groups
user_newtalk
user_properties
watchlist
watchlist_expiry
watchlist_label
watchlist_label_member
Former
blobs
brokenlinks
config
cur
external_user
hitcounter
image_comment_temp
ipblocks
ipblocks_old
links
linkscc
math
module_deps
msg_resource
msg_resource_links
old
profiling
revision_actor_temp
revision_comment_temp
tag_summary
trackbacks
transcache
user_rights
valid_tag
validate
Wikimedia extension database tables
AbuseFilter
abuse_filter_action
abuse_filter_history
abuse_filter_log
abuse_filter
AntiSpoof
spoofuser
Babel
babel
BetaFeatures
betafeatures_user_counts
BounceHandler
bounce_records
CampaignEvents
campaign_events
ce_address
ce_event_address
ce_event_questions
ce_event_topics
ce_event_wikis
ce_invitation_lists
ce_organizers
ce_participants
ce_question_aggregation
ce_question_answers
ce_tracking_tools
ce_worklist_articles
CentralAuth
globalnames
globaluser
global_edit_count
global_group_permissions
global_group_restrictions
global_user_autocreate_serial
global_user_groups
localnames
localuser
renameuser_queue
renameuser_status
users_to_rename
wikiset
CentralNotice
cn_assignments
cn_known_devices
cn_known_mobile_carriers
cn_notices
cn_notice_countries
cn_notice_regions
cn_notice_languages
cn_notice_log
cn_notice_mixins
cn_notice_mixin_params
cn_notice_mobile_carriers
cn_notice_projects
cn_templates
cn_template_devices
cn_template_log
cn_template_mixins
CheckUser
cu_changes
cu_log
cu_log_event
cu_private_event
cu_useragent
cu_useragent_clienthints
cu_useragent_clienthints_map
cuci_temp_edit
cuci_user
cuci_wiki_map
cusi_case
cusi_signal
cusi_user
Cognate
cognate_pages
cognate_sites
cognate_titles
CommunityRequests
communityrequests_counters
communityrequests_entities
communityrequests_tags
communityrequests_translations
ContentTranslation
cx_corpora
cx_lists
cx_notification_log
cx_suggestions
cx_translations
cx_translators
cx_significant_edits
cx_section_translations
CreditsSource
revsrc
srcwork
swauthor
swauthor_links
swsite
swsource_links
DiscussionTools
discussiontools_items
discussiontools_item_ids
discussiontools_item_pages
discussiontools_item_revisions
discussiontools_subscription
Echo
echo_email_batch
echo_event
echo_notification
echo_push_provider
echo_push_subscription
echo_push_topic
echo_subscription
echo_target_page
echo_unread_wikis
EntitySchema
entityschema_id_counter
FlaggedRevs
flaggedpages
flaggedpage_config
flaggedpage_pending
flaggedrevs
flaggedrevs_promote
flaggedrevs_statistics
flaggedrevs_tracking
GeoData
geo_tags
GlobalBlocking
globalblocks
global_block_whitelist
GlobalPreferences
global_preferences
GlobalUsage
globalimagelinks
GrowthExperiments
growthexperiments_link_recommendations
growthexperiments_link_submissions
growthexperiments_mentee_data
growthexperiments_mentor_mentee
growthexperiments_user_impact
Linter
linter
LiquidThreads
historical_thread
thread
thread_history
thread_pending_relationship
thread_reaction
user_message_state
LoginNotify
loginnotify_seen_net
MediaModeration
mediamoderation_scan
Math
math
mathlatexml
mathoid
nl_issues
nl_newsletters
nl_publishers
nl_subscriptions
OATHAuth
oathauth_types
(introduced in 1.41)
oathauth_devices
(introduced in 1.41)
oathauth_users
(removed in 1.40)
OAuth
oauth_accepted_consumer
oauth_registered_consumer
ORES
ores_classification
ores_model
PageAssessments
page_assessments
page_assessments_projects
PageTriage
pagetriage_log
pagetriage_page
pagetriage_page_tags
pagetriage_tags
Proofread Page
pr_index
PropertySuggester
wbs_propertypairs
ReadingLists
reading_list
reading_list_entry
reading_list_project
SecurePoll
securepoll_cookie_match
securepoll_elections
securepoll_entity
securepoll_lists
securepoll_log
securepoll_msgs
securepoll_options
securepoll_properties
securepoll_questions
securepoll_strike
securepoll_voters
securepoll_votes
ShortUrl
shorturls
TimedMediaHandler
transcode
Translate
revtag
translate_groupreviews
translate_groupstats
translate_messageindex
translate_metadata
translate_reviews
translate_sections
translate_stash
translate_tmf
translate_tms
translate_tmt
translate_cache
translate_translatable_bundles
UploadWizard
uw_campaigns
UrlShortener
urlshortcodes
WikibaseQualityConstraints
wbqc_constraints
Wikibase Client
wbc_entity_usage
Wikibase Repository
wbt_item_terms
wbt_property_terms
wbt_term_in_lang
wbt_text_in_lang
wbt_text
wbt_type
wb_changes
wb_changes_subscription
wb_id_counters
wb_items_per_site
wb_property_info
WikiLambda
wikilambda_zobject_function_join
wikilambda_zobject_join
wikilambda_zobject_labels
wikilambda_zobject_label_conflicts
wikilambda_ztester_results
wikilambda_zlanguages
WikiLove
wikilove_log
WikimediaCampaignEvents
wikimedia_campaign_events_grant
Retrieved from "
Categories
Database
MediaWiki database tables
Manual
Database layout
Add topic