treasuredb/schema/triggers/revokeTransfer.sql

12 lines
204 B
MySQL
Raw Normal View History

CREATE TRIGGER revokeTransfer
BEFORE DELETE ON Transfer
2017-01-22 21:20:17 +01:00
WHEN OLD.amount > 0
BEGIN
2017-01-22 21:20:17 +01:00
INSERT INTO __INTERNAL_TRIGGER_STACK VALUES (
OLD.ROWID, OLD.billId, OLD.credId, -OLD.amount
);
END;