Suggestion: Checkbox to turn off foreign key constraints when dropping parent table (and not to drop it inmediately!)

[expired user #9813]'s profile image [expired user #9813] posted 8 years ago in Feature discussion Permalink

When right-click -> Drop ... (or Shift + del) and confirm on a parent table that have child rows, by default HeidiSQL drops the table without checking foreign key constraints. I consider it appropriate to display a Turn off foreign key checks? checkbox in the confirmation dialog box, and that the default behavior is checks foreign key constraints (in other words, the checkbox should appear unchecked by default).

PS: Sorry for my English. It is not my native language.

ansgar's profile image ansgar posted 8 years ago Permalink

You know that HeidiSQL always fires a SET FOREIGN_KEY_CHECKS=0 before dropping tables, currently?

[expired user #9813]'s profile image [expired user #9813] posted 8 years ago Permalink

Thanks for your prompt response!

I did not know it. Therefore my suggestion is that the default behavior is not to fires SET FOREIGN_KEY_CHECKS = 0 unless the user states it to HeidiSQL (or else that HeidiSQL warns to user that the FOREIGN_KEY_CHECKS = 0 statement is fires before table dropping). This could prevent data loss by not realizing that a table to be deleted has child tables pointing to it, or by trust that a parent table will not be deleted unless it does not have children.

Please login to leave a reply, or register at first.