Auditor Function Overhaul
authorThomas Berezansky <tsbere@mvlc.org>
Mon, 21 Nov 2011 16:18:49 +0000 (11:18 -0500)
committerJason Stephenson <jstephenson@mvlc.org>
Thu, 8 Mar 2012 16:47:33 +0000 (11:47 -0500)
commit84e5680288d9410d9aebd7f1433c44a3fd250d49
tree5e40f1cb4c07227ca8c43701445d67bcbe139abe
parentbe831c2460fa4914b10c6dd468a66cb145ab85e5
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>
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Open-ILS/src/sql/Pg/900.audit-functions.sql