Bug #55988 Changing the foreign key type is not impacted on referencing table
Submitted: 15 Aug 2010 11:12 Modified: 12 Feb 2013 23:21
Reporter: Gaël Lhez Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2.26CE rev6432 OS:Microsoft Windows (win7 x64)
Assigned to: CPU Architecture:Any
Tags: foreign key, modeling, workbench

[15 Aug 2010 11:12] Gaël Lhez
When I change the type of a referenced column, for example from BIGINT to INT, or also from INT to UNSIGNED INT, the modification is not reported on the referencing table. 

It also produce errors on the generated script when runt in Query Browser, as the server produce a "Error Code: 1005 Can't create table 'schema.table' (errno: 150)

How to repeat:
1. Create a table A, with a primary key being a BIGINT or INT
2. Create a table B, with whatever primary key
3. Create a 1:1 relationship with so that B reference A.
4. Change the type of A primary key to UNSIGNED INT.
5. Forward engineer
6. Enjoy the error !

Suggested fix:
There should be some "primary key change" listener, so that when the primary key's type is updated, any referencing column would be updated (and perhaps, with an warning message in case where the primary would consist of more than one column).
[24 Aug 2010 10:17] Valeriy Kravchuk
Thank you for the problem report.
[12 Feb 2013 23:21] Alfredo Kojima
Duplicate of bug #56430