I am trying to figure out relationships and deletion options.
I have two tables, User
and UserStaff
, with a 1:n relationship from User
to UserStaff
(a user can have multiple staff members).
When my User
is deleted, I want to delete all of the UserStaff
tables associated with that User
. When my UserStaff
is deleted, I don't want anything to happen to User
. I understand that this is a cascading relationship, but I'm not sure which way.
i.e. Do I select the existing foreign key in my UserStaff
table and make it cascading, or do I create a new foreign key in User
and set that to cascading?