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

12 lines
204 B
SQL

CREATE TRIGGER revokeTransfer
BEFORE DELETE ON Transfer
WHEN OLD.amount > 0
BEGIN
INSERT INTO __INTERNAL_TRIGGER_STACK VALUES (
OLD.ROWID, OLD.billId, OLD.credId, -OLD.amount
);
END;