MySQL Workbench will not allow the user to add foreign keys in certain situations, and will not give adequate error messages so the user can fix them.
Some important things to remember when altering a table to add foreign keys in MySQL Workbench.
1.
Both columns must be EXACTLY the same type. If one column is unsigned INT(10), the other must be unsigned INT(10).
2.
Since, MySQL Workbench will make an index of a foreign key, the foreign key MUST BE AN INDEX of the referenced table, otherwise the script will not be successful.
No comments:
Post a Comment