Say you have a table schema such as this: friends(friendship_id, uid1, uid2, are_friends)
.
When one friend un-friends another person, is it best practice to delete that row from the database (and reset auto-incrementing)? Or should you simply change the are_friends status to 'N'?
I'd love to know what you think and why.
EDIT: My primary concern is showing some information about the state of the friends, and also showing who friended who. That way at the time of the add I can notify the friended of the friender's request and yet not have them be friends yet.
I had originally had are_friends
as a large ENUM
with more options. But in that ENUM
I had options such as removed
and blocked
, and I wasn't sure whether that was truly useful data or not. Any further thoughts on the merits of having more vs. less data?
Also, an added question I've had since I posted is how one should avoid duplicating friendships. Should you make (uid1, uid2)
a primary key?