Bug #51124 Workbench has no method to drop a foreign key
Submitted: 11 Feb 2010 22:14 Modified: 12 May 2010 15:11
Reporter: Barry Galbraith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench: SQL Editor Severity:S3 (Non-critical)
Version:5.2.15 OS:Windows (WinXP)
Assigned to: Sergei Tkachenko CPU Architecture:Any

[11 Feb 2010 22:14] Barry Galbraith
Description:
Define a foreign key between two tables.
Try to alter or drop the foreign key. There is no method available.

How to repeat:
Define a foreign key.
Try to alter the foreign key. There is no method available.
Try to drop the foreign key. There is no metod available.

Suggested fix:
Provide a method to alter or drop a foreign key.
[11 Feb 2010 23:48] MySQL Verification Team
Delete FK

Attachment: fk.png (image/png, text), 87.07 KiB.

[11 Feb 2010 23:50] MySQL Verification Team
Thank you for the bug report. Could you please take a look in the prior attached picture. Thanks in advance.
[12 Feb 2010 0:53] Barry Galbraith
In SQL editor, select the table.
Right click, select Alter table.
Select the Foreign Keys tab.
Change On Update and/or On Delete action.
Click on Apply
The foreign key CANNOT be altered.
Any attempt results in error "Type mismatch: expected type string, but got list.
The On Update / On Delete actions cannot be set or changed from the EER view.

So, the only method is to Create FK in SQL editor. If it needs changing, then Drop it in EER view, and re-create in SQL view.

?!?!?!
[15 Feb 2010 9:07] Valeriy Kravchuk
Thank you for the bug report. Indeed, there is no good way to alter foreign key in SQL Editor.
[15 Apr 2010 10:59] Sergei Tkachenko
Can't repeat with snapshot version (5.2.18+).
[10 May 2010 18:32] Johannes Taxacher
confirmed working in repository
[12 May 2010 15:11] Tony Bedford
An entry has been added to the 5.2.21 changelog:

In the Alter Table dialog of the SQL Editor, there was no effective way of altering a foreign key.