According to what I read somewhere, FOREIGN_KEY_CHECKS
:
... Specifies whether or not to check foreign key constraints for InnoDB tables.
That is, if the guy wants to disable the foreign keys check, it does:
SET FOREIGN_KEY_CHECKS = 0;
I know it's common to use this command in case of dumps to do bank migration, backups, and the like ... But I wonder if something that can disable foreign key checking may or may not be harmful to a application.
I have the following questions:
- In what types of scenarios would it be valid or not to use
FOREIGN_KEY_CHECKS
with the value0
? -
FOREIGN_KEY_CHECKS
is something to be considered in restricting in production environment? Is it something that may cause some kind of inconsistency in my application / database? - If it is possible to disable the modification in
FOREIGN_KEY_CHECKS
, how is the procedure?