Hi,

I have two tables like this:

CREATE TABLE IF NOT EXISTS folders (name TEXT NOT NULL ON CONFLICT ROLLBACK, parent INTEGER REFERENCES folders (ROWID) ON DELETE CASCADE);

CREATE TABLE IF NOT EXISTS documents (document TEXT NOT NULL ON CONFLICT ROLLBACK, folder_id INTEGER REFERENCES folders (ROWID) ON DELETE CASCADE, name TEXT NOT NULL ON CONFLICT ROLLBACK);

If I try to add a rows to a fresh database like this:

INSERT INTO folders (parent, name) VALUES (3,'New Folder');
INSERT INTO documents (document, folder_id, name) values ('some text',3,'the name');

I can do it eventhough it violates the foreign key constraints (ROWID of the row in folders table is 1). What's wrong with my table definitions? My sqlite3.exe's version is 3.7.11 and according to the documentation the foreign key constraints should be enforced.

-Marko
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to