[open-ils-commits] r15756 - branches/rel_1_6_0/Open-ILS/src/sql/Pg (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Mar 9 07:09:07 EST 2010
Author: dbs
Date: 2010-03-09 07:09:06 -0500 (Tue, 09 Mar 2010)
New Revision: 15756
Modified:
branches/rel_1_6_0/Open-ILS/src/sql/Pg/1.6.0.3-1.6.0.4-upgrade-db.sql
Log:
Also upgrade the money.materialized_summary_billing_add () function to maintain mmbxs
Modified: branches/rel_1_6_0/Open-ILS/src/sql/Pg/1.6.0.3-1.6.0.4-upgrade-db.sql
===================================================================
--- branches/rel_1_6_0/Open-ILS/src/sql/Pg/1.6.0.3-1.6.0.4-upgrade-db.sql 2010-03-09 12:04:40 UTC (rev 15755)
+++ branches/rel_1_6_0/Open-ILS/src/sql/Pg/1.6.0.3-1.6.0.4-upgrade-db.sql 2010-03-09 12:09:06 UTC (rev 15756)
@@ -132,6 +132,18 @@
) credit ON xact.id = credit.xact
ORDER BY debit.billing_ts, credit.payment_ts;
+/* BEFORE or AFTER trigger only! */
+CREATE OR REPLACE FUNCTION money.mat_summary_update () RETURNS TRIGGER AS $$
+BEGIN
+ UPDATE money.materialized_billable_xact_summary
+ SET usr = NEW.usr,
+ xact_start = NEW.xact_start,
+ xact_finish = NEW.xact_finish
+ WHERE id = NEW.id;
+ RETURN NEW;
+END;
+$$ LANGUAGE PLPGSQL;
+
-- And rebuild the materialized view that was built on money.billable_xact_summary
TRUNCATE TABLE money.materialized_billable_xact_summary;
INSERT INTO TABLE money.materialized_billable_xact_summary
More information about the open-ils-commits
mailing list