treasuredb/schema/triggers/x_changedTransfer.sql

9 lines
332 B
MySQL
Raw Normal View History

2017-02-21 22:24:27 +01:00
CREATE TRIGGER x_changedTransfer
BEFORE UPDATE OF timestamp, credId, billId, amount ON Transfer -- Allow update of note
WHEN OLD.amount IS NOT NULL
2017-01-22 21:20:17 +01:00
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;