Instead of deleting or re-creating the constraint, I prefer this simpler way. Disable constraint checking by first executing the following query:
SET FOREIGN_KEY_CHECKS=0;
Then crop your tables
Finally, activate the constraint check:
SET FOREIGN_KEY_CHECKS=1;
This is a common solution when migrating databases, so you donβt have to worry about how tables are inserted.
Franz source share