I tried many times to get MySQL Workbench to automatically generate ERDs with relationship lines, but always left disappointment. Most of the databases I worked with used MyISAM tables without specific foreign keys. This seemed to stop Workbench from generating the relationships I wanted, or I just couldn't figure out how to make it work. I also tried many other solutions, but again did not find a convenient solution that I was looking for until I came across this blog post on mysqlworkbench.org.
MySQL Workbench Plugin: automatic creation of foreign keys
The post is a complete explanation of how to force Workbench to search all your tables for candidate foreign keys in other tables. It even shows how to get a working graphical interface for it. Best of all, the article refers to a Python script that can be installed in Workbench as a plugin so that you can handle everything for you.
After installing the plugin, you launch it and give it a template that will be used to check the correspondence of the keys. He then gives you a list of keys that he considers matching, which you can choose if you agree. Then you press the button and generate an ERD for you with all the relationship lines. Hallelujah!
Many thanks to akojima at MySQL Workbench. Now, if I could take Delorean for another four years and find it when it was published in 2010.
source share