fixes after testing. Tests still fail.

This commit is contained in:
Florian "flowdy" Heß 2016-06-25 17:49:25 +02:00
parent 769dcebc92
commit 1cd71974c4

View File

@ -175,7 +175,7 @@ BEGIN
billId billId
FROM Transfer FROM Transfer
WHERE fromCredit = NEW.Id WHERE fromCredit = NEW.Id
ORDER BY date DESC ORDER BY timestamp DESC
LIMIT 1 LIMIT 1
; ;
@ -212,11 +212,10 @@ CREATE TRIGGER rebalanceIncreasedCredit
WHEN NEW.value > OLD.spent WHEN NEW.value > OLD.spent
BEGIN BEGIN
REPLACE INTO Transfer REPLACE INTO Transfer (fromCredit, billId)
SELECT OLD.Id AS fromCredit, SELECT OLD.Id, t.billId
billId
FROM Transfer t FROM Transfer t
JOIN CurrentDebts cd ON t.billId = cd.billId JOIN CurrentDebts cd ON t.billId = cd.billId
; ;
END; END;