From: Codey Kolasinski Date: Mon, 25 Jan 2016 17:01:37 +0000 (-0500) Subject: money.mat_bill_xact_sum anonymize user not delete X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d9c45a30817bb16c9d407b2ab1db7a11a5df958a;p=working%2FEvergreen.git money.mat_bill_xact_sum anonymize user not delete During the circulation anonymization process, the money.materialized_billable_xact_summary row for the circ is deleted. This is problematic for reports which relies heavily on this table. Rather than delete the row, the change will anonymize the user. Signed-off-by: Codey Kolasinski --- diff --git a/Open-ILS/src/sql/Pg/080.schema.money.sql b/Open-ILS/src/sql/Pg/080.schema.money.sql index 3bba2edf91..cf031bc5b5 100644 --- a/Open-ILS/src/sql/Pg/080.schema.money.sql +++ b/Open-ILS/src/sql/Pg/080.schema.money.sql @@ -289,7 +289,9 @@ $$ LANGUAGE PLPGSQL; /* AFTER trigger only! */ CREATE OR REPLACE FUNCTION money.mat_summary_delete () RETURNS TRIGGER AS $$ BEGIN - DELETE FROM money.materialized_billable_xact_summary WHERE id = OLD.id; + UPDATE money.materialized_billable_xact_summary SET usr=NULL WHERE id = OLD.id; + /* DELETE FROM money.materialized_billable_xact_summary WHERE id = OLD.id; */ + RETURN OLD; END; $$ LANGUAGE PLPGSQL;