Saturday, 15 August 2015

mysql - Seen logic for Social site function -


I am creating a social site and I'm just confused with my logic for my view here

  viewed table __________________________________ | Watch_id | See_tif_id | Watch_weaver | ---------------------------------- | 1 | 1200 | 352,1,444.  

with my table

  seen_notif_ID column  

from my

  Notif table  

All user actions are being added to the Notif table and for this there is a trigger function inside the database, which was added to the table added to the table is.

Viewed_View column If a user clicks on notification with a specific ID of notification, then I will just update this column and add user_id. I also have a stock process inside the database, where I can look at the Iviewers column to see if I have already seen that information ID.

This is a way that I already have special posts / comments / tags / etc.

Is it OK to implement it? By creating a table for UNNOTIFY?

This is not the way to do it at all. Read some tutorials on database generalization. If you want to track who sees what, do not keep a separate comma separated list of your ID: Create a separate table, where each ID is a separate line. It is a basic database design. Do research to see one-to-many and many-to-many relationships. Then you will not waste time in running some 'reverse-concat' functions.


No comments:

Post a Comment