Dependant relationships

For example a "like" on a post is dependant on both a user and a post. If both the user and the post have a dependant relationship, when one of them is deleted, so is the "like".