46

I am creating a visual representation of my existing database with MySQL Workbench and I am able to synchronize the models with the "Database -> Synchronize Model..." menu. However, every time I synchronize (update) my model, I have to recreate the EER Diagram and rearrange all the tables. Is there a way to update or synchronize the EER Diagram as well? Thanks.

dgilperez
  • 9,981
  • 8
  • 60
  • 89
Tiago Alves
  • 1,261
  • 1
  • 15
  • 30

4 Answers4

65
  • Database > Synchronize Model...
  • Choose Stored Connection
  • Select the Schemata
  • Choose which to update: Model or Source (in your case, point arrows to Model)
Matthieu M.
  • 251,718
  • 39
  • 369
  • 642
Jeff B
  • 666
  • 6
  • 4
  • Actually that did it. I just installed the current version of MySQL Workbench (v5.2.33) and the Model Synchronized as I expected without me having to re-organize all the tables. Thanks! – Tiago Alves May 06 '11 at 10:45
  • 7
    That sync just drives me crazy. I only want to update the visual representation (e.g. DatabaseModel.mwb file) but the changes are always applied to the database itself and not the visual representation! What I am doing wrong? – hfrmobile Jun 10 '13 at 10:36
  • 8
    When you are in "Select changes to apply" - Model and Database Differences, your arrow is green and pointing to the right, you must select that row and click on "Update Model" button. – Jaroslav Štreit Oct 01 '14 at 14:24
2

Are you by any chance using a MySQL DB engine that doesn't support foreign keys (e.g. MyISAM?)? Hence, the relations between the tables is not saved on the MySQL server and get lost during synchronization to the workbench.

But I realize this is only the 'why' of your question. I cannot provide an answer that would preserve your arrangement without using an engine that supports foreign keys, e.g. InnoDB.

ingkebil
  • 132
  • 6
1

When I have more than 3 tables to sync, with changes on relations, I changes arrow direction (model <- source), I check "Skip DB changes and update model only" and Execute...

The "Progress of Model and Database Synchronization" window hang with "Apply changes to Model" highlighted. No processor working, nothing move...

I click the X of the window and redo the process again. Clicking the DB, ignore (all), and selecting less tables to update.

v.5.2.44 ce rev 9933

EDIT: Version 5.2.47 correct this bug !!! Yé !

François Breton
  • 1,020
  • 14
  • 23
1

I was having a variant of this problem--somehow when I would update the model from the database, one of my tables and its corresponding updatable view wouldn't update.

I believe what was happening is that the model was actually updating, but not the diagram. I didn't really make the distinction at first.

Anyway here's how to get the refresh on the E/R diagram:

  1. Delete the nonupdating object(s) from the diagram. (Just right click and choose "Delete".)
  2. Find the objects in the catalog view in the left sidebar.
  3. Drag them back onto the diagram.

Now they should reflect the model (which should reflect the DB if you followed the accepted answer above.)

  • 1
    This doesn't work on 6.3.6. When you delete a table from the diagram, it deletes it from the catalog as well. You can't add or re-add a table to a diagram's catalog, so you must create a new diagram in order to refresh the schema. Bit of an oversight by Oracle. – GreenRaccoon23 Jun 30 '17 at 18:14