From d9c45a30817bb16c9d407b2ab1db7a11a5df958a Mon Sep 17 00:00:00 2001 From: Codey Kolasinski Date: Mon, 25 Jan 2016 12:01:37 -0500 Subject: [PATCH] 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 --- Open-ILS/src/sql/Pg/080.schema.money.sql | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; -- 2.11.0