Manual:Database layout/diagram

From MediaWiki.org
Jump to: navigation, search

(file description page)

Data source[edit]

The data source and MySQL Workbench files used to generate the SVG is published at Krinkle/mwDatabaseSchema on GitHub.

Create diagram[edit]

If in doubt, ask Krinkle.

  1. Download and install MySQL Workbench.
  2. Download maintenance/tables.sql (raw) from the latest stable MediaWiki version (currently: 1.29.2). Checkout the tag using Git, or download the tarball. If downloading from the web viewer, be sure to save as ".sql" instead of ".txt".
  3. Create new MySQL Workbench Model document.
    1. Look out for a "Templates" section that may contain an example "user" or "category" table by default. Delete these before importing. Due to a bug, the code for these tables will be ignored if templates of the same name exist. (Version 6.3)
  4. Use "File / Import / Reverse Engineer SQL Script" to import MediaWiki's tables.sql. Be sure to use UTF-8 encoding and tick "Place imported objects on a diagram".

    Import of SQL script file '~/Downloads/1.29.2.tables.sql' has finished.
    40 tables, 0 views and 0 stored procedures were imported in 0 schemas.

  5. The tables are now drawn on the canvas. They're not organised yet, though. Use the #Layout guide to decide which layers to create, and move around the table figures to in their respective layer box.
  6. Export to SVG.
  7. Edit SVG and trim the excessive space from the <svg>'s width, height, and viewBox attributes. Easiest is to open it in a browser, lower the viewBox values until there is little space left on the right and bottom (but not cropped). Then update the width and height attributes as well. For example, for mediawiki-schema-1.24.1 width="1676.976378pt" height="1565.801575pt" viewBox="0 0 1676.976378 1565.801575" was the generated element, and trimmed to width="1400pt" height="1200pt" viewBox="0 0 1400 1200".
  8. Upload to Commons as File:MediaWiki 1.29.2 database schema.svg (Do not overwrite any existing diagram on Commons).
    • Add |other_versions={{Other versions/MediaWiki database}} to the Information template.
  9. Add it to commons: MediaWiki#MediaWiki database schemata.
  10. Update the commons: File:MediaWiki database schema latest.svg redirect.

Layout[edit]

This is a description of the annotations and composition we use to visualise the relationships between tables.

For the captions, use the first line of the relevant manual page about that table.

Database schema of MediaWiki 1.29.2 (November 2017)
Refer to https://www.mediawiki.org/wiki/DB for more details.
User Logging Tags Recent changes

Background: #C5E8B4

Background: #D8FFFC

Background: #FFF1C2

Background: #C5E8B4

Pages Link tables Multimedia

Background: #FFF1C2

Background: #FFF1C2

Background: #F7CCFF

Statistics Search

Background: #D8FFFC

Background: #D8FFFC

Interwiki Caching tables ResourceLoader Maintenance

Background: #E8D0C9

Background: #D8FFFC

Background: #D8FFFC

Background: #E8D0C9

See also[edit]