Bug #32907 refactoring: Foreign key column not updated when referenced column changes
Submitted: 2 Dec 2007 8:11 Modified: 30 Jul 2009 22:48
Reporter: Gerard van Beek Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Workbench Severity:S4 (Feature request)
Version:5.0.10 OS:Windows (XP SP2)
Assigned to: CPU Architecture:Any
Tags: key foreign update, refactoring

[2 Dec 2007 8:11] Gerard van Beek
Description:
When an attribute (name, type) of the primary key is changed, the foreign key definition is not updated.

How to repeat:
Create 2 tables, both with a primary key. Create a 1-n relationship between the tables. The foreign key definition is created automatically. Now change de name or the datatype of the primary key. The definition of the foreign key is not updated.

Suggested fix:
Update name/type of foreign key definition when the primary key definition is modified.
[2 Dec 2007 11:16] Sveta Smirnova
Thank you for the report.

I can not repeat described behaviour.

Just new column name is not changed in my case, all references and foreign key definition is updated.
[2 Dec 2007 22:40] Gerard van Beek
I've added an example of the result I get. I changed the datatype of the primary key of table b to VARCHAR(20. The foreign key definition in table a still shows MEDIUMINT.
[3 Dec 2007 13:24] Johannes Taxacher
Workbench doesn't provide this feature (yet).
We'll make this a feature request.
thanks
[30 Jul 2009 22:47] Alfredo Kojima
This is a refactoring feature and will be implemented in the future.
[30 Jul 2009 22:48] Alfredo Kojima
Another feature request for the same functionality has been filed in bug #38801