treasuredb/schema/triggers/x_paidFromBeginning.sql
Florian "flowdy" Heß 5299966837 Changed FAIL -> ABORT trigger exceptions
With FAIL, triggers choke but leave the changes in despite. We need to have the current statement undone, however.
2017-02-22 21:58:47 +01:00

8 lines
156 B
SQL

CREATE TRIGGER x_paidFromBeginning
BEFORE INSERT ON Debit
BEGIN
SELECT RAISE(ABORT, "Debt must be initially unpaid")
WHERE NEW.paid <> 0;
END;