DbSchema | MySQL - How to DROP Foreign Key CONSTRAINTS
1.Using SQL
In MySQL you can DROP the Foreign Key constraints from a table by executing the next query:
ALTER TABLE __table`
DROP FOREIGN KEY __id_name_fk`;
If you want to disable the foreign keys just temporary, you can use the next query:
To disable
SET FOREIGN_KEY_CHECKS=0;
To enable
SET FOREIGN_KEY_CHECKS=1;
If you want to execute the DROP CONSTRAINT in MySQL, you have to also drop the indexes.
ALTER TABLE __table`
DROP FOREIGN KEY __id_name_fk`;
2.Using DbSchema
In DbSchema, you can drop the constraints straight from the diagram.
Open the tables in the layout;
Right-click on the foreign key;
Select Drop.