Hi list,

I'd like ideas / recommendations on implementing and auditing to track delta 
changes to tables.

I have about 6 tables in my db with different fields/columns and PK's.

My original thought was to have a single audit table for all of them such as
audit_delta ( id integer, tab text, operation text, ts timestamp, delta blob)

I need to be able to either post entries to the audit delta and apply the 
changes or to write to the tables themselves and reverse out changes 
dynamically.

For example, tab1 (a,b,c) might contain data
    1, 2, 0
    1, 3, 1
    1, 4, 1

and say a new row was added at timestamp N. (this could also be an update)
    1, 2, 0
    1, 3, 1
    1, 4, 1
    1, 1, 1

I either need to be able to get the set of data prior to time N or to be able 
to apply the delta that occured before after time N  but before N + 1


SO my quesiton would be, is it better to a maintain the delta's externally ie 
roll the change forward or apply the delta to the table immediately and track 
the prior values to "undo" or reverse out the changes?

Thanks for any ideas you may have.

Ken



_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to