Topic: Journal Tables
Hi,
I need an audit/journal mechanism in indicia, which takes track of changes on entities. My suggestion would be to create a 2nd schema 'aud' where we store this information. In the schema aud we put the audited tables. They get tow extra columns: rev and change_date. When ever an update occurs on a audited table, the effected rows are copied to the table in the aud schema before.
So the current value is stored in the main schema, the historical data in the aud schema. This saves disk space because not changed rows are not duplicated. Doing this inside the database and not in the php code has the advantage that also changes made by the administrator directly in the database are tracked.
Attached is a sql script for auditing the occurrence table.
What do you think about this?
Regards
Daniel