Bug #33326 The foreign key are not showed automatically after reload.
Submitted: 18 Dec 2007 7:50 Modified: 2 Feb 2008 17:59
Reporter: T. M. Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.10 OS:Microsoft Windows (XP (32bits))
Assigned to: Assigned Account CPU Architecture:Any
Triage: D3 (Medium)

[18 Dec 2007 7:50] T. M.
Description:
Hi,

When you reload a model after a reverse engineer, the foreign keys are not automatically showed.

How to repeat:
1 Create this structure

CREATE TABLE `table1` (
  `id` int(11) NOT NULL auto_increment,
  `field2` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE `table2` (
  `id` int(11) NOT NULL,
  `field2` int(11) default NULL,
  `id_table1` int(11) default NULL,
  PRIMARY KEY  (`id`),
  KEY `id_table1` (`id_table1`),
  CONSTRAINT `table2_fk` FOREIGN KEY (`id_table1`) REFERENCES `table1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

2 - launch a reverse engineer of the database and save the model.
Note that if you put the 2 tables on a diagram at this point, you will see the foreign key drawed.

3 - Close workbench, re-launch workbench, and re-load your saved model.

4 - Now if you put your 2 tables in a diagram, workbench will not draw foreign key.

Suggested fix:
Show the foreign key automatically even after reload.
[18 Dec 2007 8:59] Valeriy Kravchuk
Thank you for a problem report. Sorry, but I can not repeat the behaviour described with 5.0.10 SE Revision 2272. Please, check again.
[18 Dec 2007 9:55] T. M.
It's ok with this small exemple.

See attachement, with a bigger database, it's not working.
[18 Dec 2007 10:39] Valeriy Kravchuk
What tables from you bigger example should I put on the diagram? Name those that have foreign keys.
[18 Dec 2007 11:46] Valeriy Kravchuk
Verified just as described in your last private comment.
[2 Feb 2008 17:59] Alfredo Kojima
This is the same problem as in bug #34154