mysql - Seen logic for Social site function -
i'm making social site , i'm confused logic seen function. here
seen table __________________________________ |seen_id|seen_notif_id|seen_viewers| ---------------------------------- | 1 | 1200 | 352,1,444 |
with table
seen_notif_id column
comes
notif table
all user actions being added notif table , trigger function inside database after insert in notif table added seen table.
for seen_viewers column. if user clicks notification specific id of notification, update column , add user_id. have stock procedure inside database can reverse concat seen_viewers column verify if seen notification id.
this way if user viewed particular post/comments/tags/etc .
is okay implement? making table unnotify?
that not way @ all. read tutorials on database normalization. if want track saw what, not keep comma-seperated list of ids: make seperate table each id seperate row. basic database design. research one-to-many , many-to-many relationships see how done. not wasting time running 'reverse-concat' function.
Comments
Post a Comment