treasuredb/schema/triggers/x_changedTransfer.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

9 lines
332 B
SQL

CREATE TRIGGER x_changedTransfer
BEFORE UPDATE OF timestamp, credId, billId, amount ON Transfer -- Allow update of note
WHEN OLD.amount IS NOT NULL
AND NOT EXISTS (SELECT * FROM __INTERNAL_TRIGGER_STACK)
BEGIN
SELECT RAISE(ABORT, "Transfer cannot be updated, but needs to be replaced to make triggers run");
END;