Replies: 2 comments
-
It seems that deleting the associate records from |
Beta Was this translation helpful? Give feedback.
-
Cascading deletes are set on an SQL-level, so yes, they work with the Go client. Can you clarify what is not working and if you are getting a specific error message, and show the schema of the other table as well? Say you have a user with many posts. If you delete the user, all posts would be deleted as well if cascade is set, because otherwise there would be invalid foreign keys set in the posts table. However if you delete a post, it will not delete the user because there is no dependency there. |
Beta Was this translation helpful? Give feedback.
-
We've defined our model with
onDelete: cascade
on the relation, but it doesn't seem to be working when a model is deleted using the go client.Does
prisma-client-go
actually support this feature or am I doing something wrong?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions