customize Update, Edit and Delete Queries So that Data History Can be maintained
I would like to Customise the Update, Edit and Delete Queries So that Data History Can be maintained, Using a Data Status.
I.E when editing a Data, Instead of Direct Editing, I Want to Update the Old Data as Data Status INACTIVE and Insert a Copy of the Old Data with Edited Component With data Status Active so that A history of all edits can be Kept in the DB. Once this Part is Ready i am Gonna Purchase a License from you.
-
Brett Power commented
I do this with database triggers in MySQL. For every critical table that I have there is an audit table that has the exact same structure with a few additional columns that log if it is a record update, delete or insert and the date/time that this action occurs. Additionally all of my tables have columns to log who modified the record last and the date/time that the modification occurred.
In my opinion it's best to leave these activities to the database directly and not to the PHP code. Using triggers is great because the database performs the actions automatically so there is no way that the system can fail.
-
John Munoz commented
Great idea Ravi. I'm having to code for that myself.