I'm building a Content Management website which will also include other features. When an admin member deletes an item through the admin panel, I would like this item to be moved to a 'recycle bin' for 30 days (then automatically deleted).
What is the best way of implementing this feature?
One idea I had was to have a 'Deleted' bit column in my table, then only show records WHERE Hide=0
. However this would mean having to remember to put this condition in place everytime I SELECT
from the table.
Another Idea I had was to have a second table where the records would be moved to when deleted. However I have many tables being used in my website, so this would mean doubling the amount of tables, and having duplicate table structures (which could cause consistency issues in the future).
Ideally I would like to have a 'RecycleBin' table which all the records are moved to, but this could contain 100s of columns to be able to store data from all the different tables.
If anyone has any other ideas it would be most appreciated.
Thanks.