I am trying to design tables to track if a given user has viewed a
change/addition or not.

The basic layout of the database presently is:

DocumentTable
DocID,FileName,Description,Cost,etc...

ChangeTable
ChangeID,Date,UserID,DocID,ChangeDescription

By looking in the ChangeTable I can tell what items have been added/modified
but what is an efficient way to track if a given user has viewed the item
since it was changed?
As a side note, I need the ChangeTable to provide a modifications history so
this part of the database layout is required.


I don't want to rely on the last logged in time as what I am trying for is
more akin to an email app were the item should stay 'unread' until viewed.

My initial thought is having another table such as:
UserViews
ViewID,Date,DocID

Items would be marked unread if no UserViews entry exists or the UserViews
date is older; just not sure if there is a more efficient way to do it?

Thanks

Reply via email to