Magento ERD (Attempt) with MySQL Workbench
Iβm working on a new project for Meanbee and decided that it would be best to take a more formal approach to the design of the database now that I am working more closely with Tom.
The tool I am using at the moment is MySQL Workbench 5.1 beta. The stability is not that great on Ubuntu, its a beta release for Linux and Mac after all. I get a crash every now and again, especially whenever I try to set a column to auto increment. Anyway, I decided it would be nice to try and get an up to date look at an ERD for Magento. Workbench has a pretty cool βreverse engineerβ tool which builds you a nice diagram from schemata.
Adding all the Tables to the Diagram The first problem was actually getting all of the tables onto the diagram. The way it works is that you first create the diagram, then you click and drag all of the tables from the βcatalogβ on the right hand side to the diagram in the middle. Turns out you canβt do more than one at a time this way, so if anyone is googling βmysql workbench add all tablesβ or something right now, I hope you find this post. Whilst in the βMySQL Modelβ view (the one that shows your list of diagrams at the top, the tables underneath, then the views, routines, etc, select all of your tables by hold down shift and using your arrow keys). Drag the selected tables up to your open diagram tab at the top of the screen, hover for a while until the tab opens, then drop onto the diagram. Thatβll do it.
The Result The thumbnail give you a hint at the quality of the result. Workbench has an βauto layoutβ feature which attempts to automatically place the tables in good positions around the diagram to make the interpretation that little bit easier. It didnβt do so well with Magento and itβs 229 tables. Some big improvements needed there.