Updating foreign key advice on dating a leo man
Or, more generally: If this SELECT returns any rows at all, then SQLite concludes that deleting the row from the parent table would violate the foreign key constraint and returns an error.Similar queries may be run if the content of the parent key is modified or a new row is inserted into the parent table.
CREATE TABLE child5(n, o REFERENCES parent(f)); -- Error!The foreign key for table child5 is an error because even though the parent key column has a unique index, the index uses a different collating sequence.Tables child6 and child7 are incorrect because while both have UNIQUE indices on their parent keys, the keys are not an exact match to the columns of a single UNIQUE index.Because the error occurs during a schema change, this is a DDL error.
Foreign key DDL errors are reported regardless of whether or not foreign key constraints are enabled when the table is created.
Assuming the library is compiled with foreign key constraints enabled, it must still be enabled by the application at runtime, using the PRAGMA foreign_keys command.