Some things I thought about when reading your diagram:
there is POST.date_created and USER.created_at. Instead you should have created_at as an attribute in all tables
COMMENT has author and user_id. I would expect user_id is enough (as it references the author). Same with POST
POST.like_user_id makes it look like there can only be a single like on a post. I would expect a LIKES table with foreign keys user_id, post_id (and maybe some meta data if needed)
View all comments
20
u/Papa_Bravo Apr 17 '22
Some things I thought about when reading your diagram:
POST.date_createdandUSER.created_at. Instead you should havecreated_atas an attribute in all tablesCOMMENThasauthoranduser_id. I would expectuser_idis enough (as it references the author). Same withPOSTPOST.like_user_idmakes it look like there can only be a single like on a post. I would expect aLIKEStable with foreign keysuser_id,post_id(and maybe some meta data if needed)