Forum OpenACS Development: Re: a Model to store Deleted Rows History

Posted by Jeff Davis on
ACS 3 used audit tables like that and they work (and are reasonably fast) so it's easy enough to do. Generally it's better to have a table which is a duplicate of the audited table to hold the deleted records (you can create a copy like that with "create table foo_audit as select * from foo where 0 = 1;").

With the content repository, cr_revisions just holds everything and you point at the live revision from cr_items. The disadvantage of that audit method is that you can't have unique constraints on cr_revisions columns (the advantage is rolling a revisions back or forth is trivial).