From 031c248b747cb26cf0b621dc272a44251947da9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22flowdy=22=20He=C3=9F?= Date: Sun, 22 Jan 2017 21:39:41 +0100 Subject: [PATCH] rebalanceIncreasedCredit: set billId and credId in __INTERNAL_TRIGGER_STACK row --- schema/triggers/rebalanceIncreasedCredit.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/triggers/rebalanceIncreasedCredit.sql b/schema/triggers/rebalanceIncreasedCredit.sql index 43a0841..d3031ab 100644 --- a/schema/triggers/rebalanceIncreasedCredit.sql +++ b/schema/triggers/rebalanceIncreasedCredit.sql @@ -7,7 +7,7 @@ CREATE TRIGGER rebalanceIncreasedCredit BEGIN INSERT INTO __INTERNAL_TRIGGER_STACK - SELECT t.ROWID, NEW.value, ca.difference, + SELECT t.ROWID, t.billId, t.credId, min(ca.difference, NEW.value - OLD.value) FROM Transfer t JOIN CurrentArrears ca ON t.billId = ca.billId