treasuredb/schema/triggers/enforceZeroPaidAtStart.sql
2017-01-23 19:08:04 +01:00

8 lines
158 B
SQL

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