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) 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. 50 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  guide.
 * 6) Export to SVG.
 * 7) 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.
 * 8) Upload to Commons as   (Do not overwrite any existing diagram on Commons).
 * 9) *Add  to the Information template.
 * 10) Add it to  MediaWiki.
 * 11) 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.

Diffs

 * 1.17 > 1.19: http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/tables.sql?r1=102798&r2=83137
 * 1.19 > 1.20: https://git.wikimedia.org/blobdiff/mediawiki%2Fcore.git/f0ee7f9b4a1d091a57ef236c6550b4ab7549731f/maintenance%2Ftables.sql?hb=bf4fb5ee9ea251512e736be36d9d6bca271c58d4