On Wednesday 26 Jun 2002 6:43 am, Carl Meyer wrote:
> so what i want is basically an unlimited undo or journalling feature
> for more or less every field.
>
> the idea should be to save the data-difference in some journalling
> table, but i'm not sure how this could be done properly. maybe
> somebody with some experience can help me here ?
Perhaps the simplest system is to have two tables: address and arc_address.
Use "before" triggers on address to copy the old data into arc_address and
stamp it with a version number/timestamp.
I've done something similar to this using a sequence to generate unique
version numbers for me.
The other approach is to turn the process around the other way and have
separate version codes (e.g. EDITING, SUBMITTED, 2002-06-24 etc) and
"publish" the SUBMITTED changes once a day to a "live_address" table. I
currently use something similar to this for a directory where they require
editorial approval, but the editorial bit isn't required.
- Richard Huxton