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