Manual:Database layout/diagram instructions

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

Create diagram
If in doubt, ask Krinkle.


 * 1) Download and install MySQL Workbench.
 * 2) Download   (raw) from the latest stable MediaWiki version (currently:  ). 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.
 * 4) 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)
 * 5) Use "File / Import / Reverse Engineer SQL Script" to import MediaWiki's  . Be sure to use UTF-8 encoding and tick "Place imported objects on a diagram". Import of SQL script file '~/Downloads/.tables.sql' has finished. 40 tables, 0 views and 0 stored procedures were imported in 0 schemas.
 * 6) The tables are now drawn on the canvas. They're not organised yet, though. Use the  guide to decide which layers to create, and move around the table figures to in their respective layer box.
 * 7) Export to SVG.
 * 8) Edit SVG and trim the excessive space from the  's ,  , and    attributes. Easiest is to open it in a browser, lower the   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   was the generated element, and trimmed to.
 * 9) Upload to Commons as   (Do not overwrite any existing diagram on Commons).
 * 10) *Add  to the Information template.
 * 11) Add it to  MediaWiki.
 * 12) Update the commons: File:MediaWiki database schema latest.svg redirect.

Layout
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.

Credits

 * Dprutean, started this in 2009 with the MediaWiki 1.10 schema diagram, using the DbSchema software.
 * Nickj, re-created the MediaWiki 1.10 schema diagram using MySQL Workbench and started documenting how to update it.
 * Krinkle, updating the schema diagrams and documentation 2011–2019.