Bug #61440 Add user defined foreign keys to external tables
Submitted: 8 Jun 2011 8:27 Modified: 31 Jul 2013 5:34
Reporter: Stas V Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S4 (Feature request)
Version: OS:Any
Assigned to: CPU Architecture:Any

[8 Jun 2011 8:27] Stas V
Description:
It would be great to have an option to enter a foreign key manually or otherwise mark database "inactive" not to Forward Engineer it by default

How to repeat:
I am using workbench following way.
There are several MWB models containing different schemas. I have foreign keys between them all.
When I need to put a FK from one MWB file to another, I need to create fake table first and then an FK to it.

This way when I "Forward engineer" this schema I must not to forget to remove such fake tables from a list in order not to break database.

This is quite painful,because I sometimes forget to do this and have to restore everything.

Suggested fix:
I can see two possible solutions:
1) Add posibility to create a FK to a table that is not in MWB file manually.
2) Add posibility to mark a database "inactive" not to include it by default when doing Forward Engineer
[20 Jun 2011 9:37] Alfredo Kojima
Have you tried the "Select Manualy..." item in the table picking popup selector, in the FK list?
[20 Jun 2011 11:40] Stas V
Yes, it works only with tables within current model. If current model has to foreign table I want to refer - it is impossible to add a FK.

Another possible solution is to add flag "Skip when generating SQL" flag into table properties. I think this is actually simplest fix, because it is already implemented for foreign keys :D
[31 Jul 2013 5:34] Philip Olson
Fixed as of MySQL Workbench 6.0.4, and here's the changelog entry:

It is now possible to manually specify referenced tables and columns to
alter forward engineering behavior. A stub table is created for this,
which is not forward engineered.

Thank you for the bug report.