I\'m following the instructions from the SQLite documentation at http://www.sqlite.org/foreignkeys.html however my attempt to add a foreign key is failing. Here are my crea
Simply you are missing checklist_id
column in your item table. You need to declare it before you want to set it as FOREIGN KEY
. You tried to create FK
on non-existing column and this is reason why it doesn't work.
So you need to add this:
checklist_id INTEGER,
FOREIGN KEY(checklist_id) REFERENCES checklist(_id)
now it should works.