Reputation: 327
I'm working with MySQL Workbench and really like the Model feature, but what do I do if I create a Model and forget a table? Can you add an existing table to a model you're working in or do you have to start from scratch and re-import every time? I haven't seen any answers after some initial googling. Thank you in advance for the assistance!
Upvotes: 6
Views: 5017
Reputation: 111
Hope it helps
Upvotes: 1
Reputation: 40613
Copy the table you want to place in the model from the model with ctrl-c and place it to the EER diagram with ctrl-v.
Upvotes: 4
Reputation: 1616
Go to Database menu, Synchronize Model, follow the wizard, but on the "Select Changes to Apply" step, make sure you change the arrow direction to "Update Model". You can either double click on the arrow to change it, or click the button "Update Model". You have to do this for each object. If you just add one table, "Ignore" all of the changes, and just select the one table and choose "Update Model" for it.
Image borrowed from google image search:
Upvotes: 5
Reputation: 53582
By "existing table" you probably mean a table that is defined in an SQL file or a database, right? MySQL Workbench comes with a synchronization features, which allows to keep a model and/or a MySQL source in synch. It's a two-way tool, which allows detailed settings what to synch how. So, when you have created your model from an sql file or a MySQL server, you can any time synchronize it with that source again to take over changes (e.g. added tables).
For that you start synchronization with any source:
and then pick a db server or an sql file as source and target. You can even save the changes in an alter script, e.g. to reapply it to multiple servers or for archiving purposes.
Upvotes: 0