Question

I just downloaded MySQL Workbench 5.2 and really like it. I created a database using New Connection and created my database like normal. I then created an EER Model and used the database. Then i edited some fields in my database (in the non EER model one) but the new data doesn't update in the EER Model. Is there a way that i can automatically update the data from the database in the EER Model without creating a new EER Model every time? Thanks

EDIT: Also is there a way to create a foreign key outside the EER Model interface. Or does it have to be done ther?? Thanks

Was it helpful?

Solution

You must re-create the ER diagram based on the changes you made to your database. Workbench does not do this automatically (to my knowledge).

You can create foreign key constraints using the ALTER TABLE syntax. See the documentation:

InnoDB enables you to add a new foreign key constraint to a table by using ALTER TABLE:

ALTER TABLE tbl_name
    ADD [CONSTRAINT [symbol]] FOREIGN KEY
    [index_name] (index_col_name, ...)
    REFERENCES tbl_name (index_col_name,...)
    [ON DELETE reference_option]
    [ON UPDATE reference_option]

OTHER TIPS

MySQL Workbench supports a two-way synchronization. Whenever you have changed something in your model or your database just use Database -> Synchronize Model to open the sync wizard which detects all changes and offers you a detail pane where you can select what to sync in which direction (if the default doesn't fit your needs).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top