dshue20 / fbclone

Facebook clone
0 stars 0 forks source link

Schema #1

Closed mashuDuek closed 4 years ago

mashuDuek commented 4 years ago

Looks good.

  1. likes should be polymorphic, you should be able to like a post or a comment. So the likes table should have a likeable_type string column (that has to be either "post" or "comment"), and a likeable_id. The combination of these two would allow us to know which post or comment is being liked.
  2. In friendships i would call the friends? column, status, and validate its inclusion in pending, accepted, or rejected.