This project is read-only.

Issue with ON DELETE CASCADE

Oct 18, 2013 at 2:17 PM
hi,
I've tried to create two tables with a foreign key, but it does not work "ON DELETE CASCADE".
If I try to delete an Id from the parent table, the row from the parent table is deleted, but the rows in the child table are not deleted.

If i export the database created in SQLiteStudio and execute a query
DELETE FROM parent_table WHERE Id=... 
now CASCADE works perfectly and rows from both tables are deleted.
So, where i'm wrong?

I've latest SQLiteWinRTPhone source, and sqlite for windows phone 8 v 3.8.0.2.
This is source:
http://pastebin.com/Zht04v6k

Thanks in advance :-)
Oct 18, 2013 at 3:20 PM
My bad ... solved! ^_^

In GetSQLiteConnection() i've
return new Database( ... );
seems that the query "PRAGMA foreign_keys = ON" must be sent in the same instance of the Database that perform the DELETE.
Marked as answer by vipe on 10/18/2013 at 7:20 AM