MySQL Workbench - All diagrams in EER Model update when working in single diagram - mysql

I've created an EER Model for a project and I have a couple diagrams inside the model.
My problem is that I have tables with the same name in all the diagrams and when I update one table, all with the same name suffer the same alterations.
How can I avoid this behavior and have a diagram independant from the others?

With MySQL Workbench it is possible to place the same table on more than one diagram. All these "instances" (we call them figures) represent the same db object. Hence changing that table it will appear changed on all diagrams. It's the same object after all.

Related

MacOS MySQL with Workbench - How many EER Diagrams can I have?

I am used to other DBMSs where there is only one schema which includes all EER links in one Diagram. It seems as if it is possible to have multiple EER Diagrams which combine together to form the schema. Is this correct ? If so does Workbench ensure that they are all consistent ? ie if a link relationship in one diagram is changed, does workbench automatically update other affected EER Diagrams ?

Adding new table to ER Diagram

I created database and ER Diagram. Then I added new table to exsisting database. Now I would like have this table in my ER Diagram. How can I do it? Have I to create new Diagram? Of course I can use the table tool on the vertical toolbar, but if I have new table I suppose that is better way to get this table in Diagram.
First, always upgrade to the latest MySQL Workbench version (at the time being 6.0.9 with 6.1 around the corner).
I assume you created your EER diagram from the database via reverse engineering. Any time you want to update either the model or the database (schema) run the synchronization in MySQL Workbench. Open a model and go to Database -> Synchronize Model.... This is a two-way tool (model to schema and schema to model), but you can manually define the direction (or to ignore a change). Once you have synchronized your changed schema the new table will appear in the catalog tree where you can drag it to a diagram.
There should be a pane on the left titled Catalog Tree in the tab for your existing EER diagram.
You can drag and drop your new table onto the existing diagram. If the table isn't listed, do a refresh on the dbname in the tree view.

MySQL Workbench - How to update 2 different schemas from one EER Diagram?

Is it possible to use one EER Diagram currently associated with a schema called mydb with another schema mydb2?
Not currently. You can only compare two databases if they have the same name. It's a known bug:
Workbench not able to synchronize schemas with different names
Rename database schema makes synchronisation impossible

What is the difference in View and EER Diagram?

I quite confuse with both. First, both might seen the same. May I know how the View and EER Diagram is apply?
View is a stored query accessible as a virtual table composed of the result set of a query. View is the perspective on the data from tables. It actually does not store data in it but give you the access like tables from the database only thing is you may not allow to insert data in to it.
EER/ER is nothing but data modelling techniques of the database. It is not acting on data but on the structure of tables in database. Generally it gives snapshot of tables & their relation. This is helpful to get the idea that howz the data flows in a database.

MySQL Workbench - How to synchronize the EER Diagram

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.
Database > Synchronize Model...
Choose Stored Connection
Select the Schemata
Choose which to update: Model or Source (in your case, point arrows to Model)
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.
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:
Delete the nonupdating object(s) from the diagram. (Just right click and choose "Delete".)
Find the objects in the catalog view in the left sidebar.
Drag them back onto the diagram.
Now they should reflect the model (which should reflect the DB if you followed the accepted answer above.)
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Ć© !