Closed cycle-data closed 10 months ago
Never mind
When I created the connection using
sqlite_utils.Database(path)
I just needed to add the following statement right after and it did the trick
self.db.conn.execute("PRAGMA foreign_keys = ON")
Hope this helps people in the future 👍
Hi ! I noticed that when I am trying to use the delete method of the Table object, the record get properly deleted from the table, but the cascading delete triggers on foreign keys do not activate.
self.db["contact"].delete(contact_id)
I tried querying the database directly via DB Browser and the triggers work without any issue. Looked up the source code and behind the scene this method is just querying the database normally so I'm not exactly sure where this behavior comes from.
Thank you in advance for your time !