Bug #62737 Synchronize foreign key referencedMandatory property with FK nullability
Submitted: 14 Oct 2011 13:50 Modified: 27 Dec 2012 22:43
Reporter: Karsten Wutzke Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S3 (Non-critical)
Version:5.2 OS:Any
Assigned to: CPU Architecture:Any
Tags: relationships mandatory optional

[14 Oct 2011 13:50] Karsten Wutzke
Description:
WB includes functionality to set optionalities (cardinality lower bounds) via the "Mandatory" check boxes in the Foreign Key tab when double clicking on a diagram relationship (ForeignKey.mandatory and ForeignKey.referencedMandatory).

It would be worthwhile to keep the referencedMandatory disabled and set its check value according to the NOT NULL properties of the foreign key columns as this is duplicate information. This would be a much more natural behavior.

Of course this can only be performed for the "forward" direction.

How to repeat:
see above

Suggested fix:
Disable the referenced table mandatory checkbox. Adjust value as following:

As soon as one of the FKs columns becomes NULL (nullable) the mandatory check value should become "unchecked". If all FK columns are set to NOT NULL, then set the check value to "checked".
[14 Oct 2011 14:49] Valeriy Kravchuk
Thank you for the problem report and solution suggested.
[27 Dec 2012 22:43] Philip Olson
Fixed as of MySQL Workbench 5.2.45, and here's the changelog entry:

Changing a foreign key column to be nullable now deselects the mandatory
checkbox. If all foreign key columns are set to "NOT NULL", then the
mandatory checkbox value will be selected.

Thank you for the bug report.