I stumble upon strange behavior with innoDB constraint, and cannot find cause of it.
I have tables with data.
Below listed their structures:
CREATE TABL
If a call was made to
SET FOREIGN_KEY_CHECKS=0;
then FK checks are turned off. Who knows, that may be the state of your system right now. Have them turned on with
SET FOREIGN_KEY_CHECKS=1;
Note the following. Just turning checks back on does not re-validate the referential integrity. One needs ALTER TABLE
for that.
Simply publishing a schema does little to say you are safeguarded.
Meaning, I could turn off my constraints, use the system, delete some data, do LOAD DATA INFILE (in short mess up my data), then run off to Stackoverflow with a schema and say "gosh how did this happen".
And it doesn't matter what state your system is in now. It matters what it was in back then.