I have a table with operations that can be deleted by users.
What happens, is that I want to store deleted rows for some time, to serve as recover in case any client regrets the deletion.
One of the columns is id_user, so I had two ideas:
- create another table equal to the first one to store the deleted rows (the problems is to keep them equal, so any changes in the first one I have to remember to do on the second);
or
- update the rows setting
id_user=-id_user
, so that the records are not listed to this user but they are still related and I could recover them if I wanted (the problem is to store different stuff [valid and backup records] in the same table);
What is the best aproach?
PS: These records are called in a huge bunch of places in my application, adding another column implies in changing my aplication and that is out of question. If that ended up being the only solution I'd rather not to add this 'disaster recovery feature'.