[open-ils-commits] r14176 - tags/rel_1_6_0_0/Open-ILS/src/sql/Pg (miker)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sat Sep 26 12:41:47 EDT 2009
Author: miker
Date: 2009-09-26 12:41:43 -0400 (Sat, 26 Sep 2009)
New Revision: 14176
Modified:
tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/080.schema.money.sql
tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/090.schema.action.sql
tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/1.4.0.5-1.6.0.0-upgrade-db.sql
Log:
backporting r14173: Fix targetting trac ticket #70 -- populate the xact_type column in transaction summary materialization trigger
Modified: tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/080.schema.money.sql
===================================================================
--- tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/080.schema.money.sql 2009-09-26 16:40:20 UTC (rev 14175)
+++ tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/080.schema.money.sql 2009-09-26 16:41:43 UTC (rev 14176)
@@ -257,8 +257,8 @@
/* AFTER trigger only! */
CREATE OR REPLACE FUNCTION money.mat_summary_create () RETURNS TRIGGER AS $$
BEGIN
- INSERT INTO money.materialized_billable_xact_summary (id, usr, xact_start, xact_finish, total_paid, total_owed, balance_owed)
- VALUES ( NEW.id, NEW.usr, NEW.xact_start, NEW.xact_finish, 0.0, 0.0, 0.0);
+ INSERT INTO money.materialized_billable_xact_summary (id, usr, xact_start, xact_finish, total_paid, total_owed, balance_owed, xact_type)
+ VALUES ( NEW.id, NEW.usr, NEW.xact_start, NEW.xact_finish, 0.0, 0.0, 0.0, TG_ARGV[0]);
RETURN NEW;
END;
$$ LANGUAGE PLPGSQL;
@@ -283,7 +283,7 @@
END;
$$ LANGUAGE PLPGSQL;
-CREATE TRIGGER mat_summary_create_tgr AFTER INSERT ON money.grocery FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_create ();
+CREATE TRIGGER mat_summary_create_tgr AFTER INSERT ON money.grocery FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_create ('grocery');
CREATE TRIGGER mat_summary_change_tgr AFTER UPDATE ON money.grocery FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_update ();
CREATE TRIGGER mat_summary_remove_tgr AFTER DELETE ON money.grocery FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_delete ();
Modified: tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/090.schema.action.sql
===================================================================
--- tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/090.schema.action.sql 2009-09-26 16:40:20 UTC (rev 14175)
+++ tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/090.schema.action.sql 2009-09-26 16:41:43 UTC (rev 14176)
@@ -126,7 +126,7 @@
CREATE INDEX circ_circ_lib_idx ON "action".circulation (circ_lib);
CREATE INDEX circ_open_date_idx ON "action".circulation (xact_start) WHERE xact_finish IS NULL;
-CREATE TRIGGER mat_summary_create_tgr AFTER INSERT ON action.circulation FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_create ();
+CREATE TRIGGER mat_summary_create_tgr AFTER INSERT ON action.circulation FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_create ('circulation');
CREATE TRIGGER mat_summary_change_tgr AFTER UPDATE ON action.circulation FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_update ();
CREATE TRIGGER mat_summary_remove_tgr AFTER DELETE ON action.circulation FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_delete ();
Modified: tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/1.4.0.5-1.6.0.0-upgrade-db.sql
===================================================================
--- tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/1.4.0.5-1.6.0.0-upgrade-db.sql 2009-09-26 16:40:20 UTC (rev 14175)
+++ tags/rel_1_6_0_0/Open-ILS/src/sql/Pg/1.4.0.5-1.6.0.0-upgrade-db.sql 2009-09-26 16:41:43 UTC (rev 14176)
@@ -828,8 +828,8 @@
/* AFTER trigger only! */
CREATE OR REPLACE FUNCTION money.mat_summary_create () RETURNS TRIGGER AS $$
BEGIN
- INSERT INTO money.materialized_billable_xact_summary (id, usr, xact_start, xact_finish, total_paid, total_owed, balance_owed)
- VALUES ( NEW.id, NEW.usr, NEW.xact_start, NEW.xact_finish, 0.0, 0.0, 0.0);
+ INSERT INTO money.materialized_billable_xact_summary (id, usr, xact_start, xact_finish, total_paid, total_owed, balance_owed, xact_type)
+ VALUES ( NEW.id, NEW.usr, NEW.xact_start, NEW.xact_finish, 0.0, 0.0, 0.0, TG_ARGV[0]);
RETURN NEW;
END;
$$ LANGUAGE PLPGSQL;
@@ -854,7 +854,7 @@
END;
$$ LANGUAGE PLPGSQL;
-CREATE TRIGGER mat_summary_create_tgr AFTER INSERT ON money.grocery FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_create ();
+CREATE TRIGGER mat_summary_create_tgr AFTER INSERT ON money.grocery FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_create ('grocery');
CREATE TRIGGER mat_summary_change_tgr AFTER UPDATE ON money.grocery FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_update ();
CREATE TRIGGER mat_summary_remove_tgr AFTER DELETE ON money.grocery FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_delete ();
@@ -1096,7 +1096,7 @@
CREATE TRIGGER mat_summary_del_tgr BEFORE DELETE ON money.credit_card_payment FOR EACH ROW EXECUTE PROCEDURE money.materialized_summary_payment_del ('credit_card_payment');
-CREATE TRIGGER mat_summary_create_tgr AFTER INSERT ON action.circulation FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_create ();
+CREATE TRIGGER mat_summary_create_tgr AFTER INSERT ON action.circulation FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_create ('circulation');
CREATE TRIGGER mat_summary_change_tgr AFTER UPDATE ON action.circulation FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_update ();
CREATE TRIGGER mat_summary_remove_tgr AFTER DELETE ON action.circulation FOR EACH ROW EXECUTE PROCEDURE money.mat_summary_delete ();
More information about the open-ils-commits
mailing list