treasuredb/schema/triggers/x_spentFromBeginning.sql
Florian "flowdy" Heß df9c0b4065 Fixed trigger sequence
2017-02-21 22:24:27 +01:00

8 lines
160 B
SQL

CREATE TRIGGER x_spentFromBeginning
BEFORE INSERT ON Credit
BEGIN
SELECT RAISE(FAIL, "credit must be initially unused")
WHERE NEW.spent != 0;
END;