Auditor Function Overhaul
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 21 Nov 2011 16:18:49 +0000 (11:18 -0500)
committerThomas Berezansky <tsbere@mvlc.org>
Mon, 21 Nov 2011 21:53:06 +0000 (16:53 -0500)
commit69f936bf4bac375c70563a57501b79e1b2fe36d7
treea02bcfd32bba22c2551968690e45b1502887c142
parent04d57bca29380bfd648d38c28f5071f64118d293
Auditor Function Overhaul

Alter create_auditor_history to include two new columns:
    audit_user - To refer to the user who made this change
    audit_ws - To refer to the workstation they were logged into

Alter create_auditor_func to include the new columns, as well as make it
stop assuming that the auditor table and the table it is based on use the
same column ordering. In additon, make it use OR REPLACE so it can be run
again later.

Alter create_auditor_lifecycle similarly to create_auditor_func, sans the
OR REPLACE functionality.

Add five new functions:

set_audit_info - To set the user and workstation IDs
get_audit_info - Used by the auditor functions to retrieve said IDs
clear_audit_info - To remove the stored IDs for whatever reason
fix_columns - To add/remove/update columns that have changed since any
    auditors were initially created
update_auditors - To run a full pass of dropping all lifecycle views,
    update for all column changes, re-create the auditor functions, and
    re-create the auditor lifecycle views.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/src/sql/Pg/900.audit-functions.sql