Tuesday, May 27, 2008

[mysql] - Dropping tables without caring about relationships

On Mysql, to avoid having a
"Cannot delete or update a parent row: a foreign key constraint fails"
message when dropping tables with relationships between them, you can set the flag
SET FOREIGN_KEY_CHECKS=0;
at the very beginning of your sql script.

No comments: