I have a table “memberships”. It has a field user_id, which I want to
use as a foreign key to the “users” table.
So, as far as I get it, in the membership model I have to write:
In the users model, I write:
However(in case the above is correct), how do I ensure that if I delete
a user, the related entities in membership will be also deleted??