Bug #36645 undo after creating relation does not work
Submitted: 10 May 2008 16:06 Modified: 11 Jul 2008 10:05
Reporter: Bogdan Kecman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S3 (Non-critical)
Version:5.0.21-se OS:Windows (w2k8)
Assigned to: Alfredo Kojima CPU Architecture:Any

[10 May 2008 16:06] Bogdan Kecman
Description:
when creating relations in WB, undo just removes the "line" and does not remove added columns/keys

How to repeat:
create two tables
create relationship
press ctrl+z

the "line" representing relation is gone but the fields and key's are there

Suggested fix:
undo the whole operation
[14 May 2008 10:37] Johannes Taxacher
the reason for that is that when creating the relation via the table editor every step of setting up the relation is noted as seperate history/undo event (can be seen in the history panel).

we shouldn't add the "creation of the relation-figure" as seperate history/undo event.
additionally i'd propose to only display relationship figure when the while FK is set up correctly (so that when undoing the last step of FK-creation - which is specifying "referenced Column" - the line is removed because he FK isn't valid anymore)
[21 May 2008 20:59] Johannes Taxacher
FK figures are now only drawn when relation is setup correctly and removed as soon as details are removed (i.e. unchecking the target-column). firing undo after setting up the key removes the last step and therefore the FK figure.
tested in bzr rev 3111
[21 May 2008 20:59] Johannes Taxacher
FK figures are now only drawn when relation is setup correctly and removed as soon as details are removed (i.e. unchecking the target-column). firing undo after setting up the key removes the last step and therefore the FK figure.
tested in bzr rev 3111
[11 Jul 2008 10:05] Tony Bedford
An entry has been added to the 5.0.21 changelog:

The undo operation did not completely undo a relationship between two tables. It removed only the line drawn between two tables, but did not undo the fields and keys.