Jump to content
MediaWiki

Manual:Database layout

From mediawiki.org
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

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:

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 master
 actor
archive
 block
 block_target
 blobs  
 bot_passwords
brokenlinks  
 category
 categorylinks
 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 master
 change_tag_def
 collation
 comment
 content
 content_models
cur  
 externallinks
 external_user  
 file
 filearchive
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 master
 filerevision
 filetypes
 hitcounter  
image
imagelinks
 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 master
 ipblocks_restrictions
 iwlinks
 job
 l10n_cache
 langlinks
links  
linkscc  
 linktarget
 logging
 log_search
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 master
math  
 module_deps  
 msg_resource  
 msg_resource_links  
 objectcache
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 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 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 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 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 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

Diagrams

Engines
Current
Former
Technical documentation
Configuration
Development
Core tables
Current
Former
Wikimedia extension database tables
AbuseFilter
AntiSpoof
Babel
BetaFeatures
BounceHandler
CentralAuth
CentralNotice
CheckUser
Cognate
ContentTranslation
CreditsSource
DiscussionTools
Echo
FlaggedRevs
GeoData
GlobalBlocking
GlobalPreferences
GlobalUsage
GrowthExperiments
Linter
LiquidThreads
LoginNotify
MediaModeration
Math
Newsletter
OATHAuth
OAuth
ORES
PageAssessments
PageTriage
Proofread Page
PropertySuggester
ReadingLists
SecurePoll
ShortUrl
TimedMediaHandler
Translate
UploadWizard
UrlShortener
WikibaseQualityConstraints
Wikibase Client
Wikibase Repository
WikiLambda
WikiLove
WikimediaEditorTasks

AltStyle によって変換されたページ (->オリジナル) /