TablePlus-Windows icon indicating copy to clipboard operation
TablePlus-Windows copied to clipboard

Cannot Delete Fields That Are Constrained (with FOREIGN_KEY_CHECKS disabled)

Open themrflibble opened this issue 3 years ago • 2 comments

Please answer the questions below, it helps us to track the issue.

  1. Which driver are you using and version of it (Ex: PostgreSQL 10.0): MariaDB 5.5.68

  2. Which TablePlus build number are you using (the number on the welcome screen, Ex: build 81): 184

  3. The steps to reproduce this issue:

I have a failed migration from Laravel, and to delete it I used to be able to do...

SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE `db`.`table`
DROP INDEX `tab1_tab2_id_foreign`;
DROP COLUMN `that_id`;
SET FOREIGN_KEY_CHECKS=1;

Now when I run this, it reports that all three queries run, but there has been no change to the table. If you remove the last line it does spit out errors for the second line. I have concluded that the first line SET FOREIGN_KEY_CHECKS=0 does nothing, I simply cannot delete a field if it is in a contraint.

This used to work a few build ago, but I cannot get it to work any longer.

I use TablePlus on on Windows 10.

themrflibble avatar Dec 08 '21 19:12 themrflibble

Hi @themrflibble, first, could you please do not remove the issue template? It will help us to filter and check issues quickly. Second, I don't understand what problem that you faced to, could you attach the reproducing steps? Those steps will let us know exactly what's happening. More than that, thank so much for your feedback.

sonswift avatar Dec 09 '21 03:12 sonswift

Hi @themrflibble, first, could you please do not remove the issue template? It will help us to filter and check issues quickly. Second, I don't understand what problem that you faced to, could you attach the reproducing steps? Those steps will let us know exactly what's happening. More than that, thank so much for your feedback.

I have updated the above.

themrflibble avatar Dec 10 '21 16:12 themrflibble