Mysql – How to automatically update database in MySQL Workbench

eer-modelMySQLmysql-workbench

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

Best Answer

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]