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

9 lines
293 B
SQL

CREATE TRIGGER x_changedCredit
BEFORE UPDATE OF account, value ON Credit
WHEN EXISTS (SELECT * FROM Transfer WHERE credId=NEW.credId)
AND NOT EXISTS (SELECT * FROM __INTERNAL_TRIGGER_STACK)
BEGIN
SELECT RAISE(FAIL, "Credit involved in transactions to revoke at first");
END;