5299966837
With FAIL, triggers choke but leave the changes in despite. We need to have the current statement undone, however.
10 lines
392 B
SQL
10 lines
392 B
SQL
-- Prevent modification of paid value outside triggers which must adjust it exclusively
|
|
-- when new transfer records are inserted
|
|
CREATE TRIGGER x_paidChangedOutsideTrigger
|
|
BEFORE UPDATE OF paid ON Debit
|
|
WHEN NOT EXISTS (SELECT * FROM __INTERNAL_TRIGGER_STACK LIMIT 1)
|
|
BEGIN
|
|
SELECT RAISE(ABORT, "paid is set and adjusted automatically according to added Transfer records");
|
|
END;
|
|
|