On delete cascade not working
I have the following tables:
Note that int the
sets
table, there is a statement that on deletion of an exercise, the sets should also be deleted.
however, when i test this, the rows in sets
with the exercise id of the deleted exercise are not deleted.
Am I doing something wrong?2 Replies
Is your database schema in sync with your drizzle schema?
Meaning, did you apply the migration after adding the on delete?
Yes
The issue was that I was not not enabling the foreign key pragma
But I also don’t know how to do that with drizzle
So I used the execAsync from the expo sqlite