Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm using MySQL Workbench to design my MySQL database and model how entities would look like and how they would relate to each other. Now, sometimes I use Doctrine ORM. When using Doctrine ORM, I create classes/objects that are domain objects and can be persisted to a database. And through DocBlock Annotations I can express how to relate entities to each other.

With MySQL Workbench I can view an EER Diagram that shows me how objects are related, and by looking at symbols I can see relations clearly. The problem with this approach is that I need to generate database schema using Doctrine CLI. And then in MySQL Workbench I must create an EER model from an existing database. The thing is I change the database schema a lot, and to see the relations in MySQL Workbench I must create an EER model every time. This is time consuming.

Is there a way to just load an EER diagram from an existing database, and then, when the database schema changes, just refresh and see changes, so I don't have to generate the EER diagram for every little change?

I have used Navicat in the past, and there you can do that. When the database changes, just press F5 and relations change immediately in the ER diagram. The only problem with Navicat is there are no symbols between tables that show their relation. Only lines.

Is it possible to have that functionality in MySQL Workbench? If not, are there other tools with which I can see ER diagrams, and that refresh the diagrams as soon as I change the database schema?

share|improve this question
    
This question is cross posted in Stackoverflow. stackoverflow.com/questions/12872738/… –  Cdeez Oct 13 '12 at 12:05
    
True, I didnt know where to post it, so I posted it on both. Is this allowed? –  otporan Oct 13 '12 at 12:10
    
No it isn't allowed. If you feel the question doesn't suit the site you should be leaving it for the community to decide if it requires migration. –  Cdeez Oct 13 '12 at 12:17
1  
I stand corrected. Wont do that again. Thanks! –  otporan Oct 13 '12 at 12:25
add comment

2 Answers

up vote 4 down vote accepted

From the MySQL Workbench 5.2 window, select Database -> Synchronize model which will allow you to synchronize the model (EER diagram) with the database (you need to create a saved connection) for it.

I recommend this method over just reverse engineering the model from the database since it maintains the layout of the EER diagram. One caveat is that you need to add new tables to the EER diagram manually.

share|improve this answer
add comment

One thing to be careful with 'Database' -> 'Synchronize' is that it defaults to applying the diagram changes to the live database, i.e. it is suggesting statements such as:

DROP TABLE IF EXISTS h2.Import_Homol

Be careful to change this default behaviour if you are just using the EER tool for output diagrams, or your live tables will be dropped if they don't exist in the model (as will additional columns or any other schema changes).

http://dev.mysql.com/doc/workbench/en/wb-database-synchronization.html

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.