CTO, Software Engineer, Indie Hacker
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.