Hello fellow devs, I have two SQLite tables. The second table references a key from the first table as foreign key. Now when I delete a row in the first table I want all rows from the second table referencing the deleted key to be deleted as well. For this the action ON DELETE CASCADE seems to be appropriate. Unfortunately this doesn't work and the corresponding rows in the second table are *not* deleted.
Here are the table definitions: First table: CREATE TABLE IF NOT EXISTS NodeMetaData (id INTEGER PRIMARY KEY, parentId INTEGER); Second table: CREATE TABLE IF NOT EXISTS NodeConcreteData (refId INTEGER NOT NULL, FOREIGN KEY(refId) REFERENCES NodeMetaData(id) ON DELETE CASCADE); In the sqlite docs, it is mentioned that foreign key support has to be acitvated. So I tried tx.executeSql("PRAGMA foreign_keys = ON;"). But the query tx.executeSql("PRAGMA foreign_keys;") returns 0. When I recreate the scenario in an interactive SQLite session, the above works (PRAGMA foreign_keys = ON has to be executed). Any ideas? Is the SFOS Qt lib compiled with foreign key support? What am I missing? Many thanks in advance! Thomas _______________________________________________ SailfishOS.org Devel mailing list To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org