8 lines
158 B
MySQL
8 lines
158 B
MySQL
|
CREATE TRIGGER enforceZeroPaidAtStart
|
||
|
BEFORE INSERT ON Debit
|
||
|
BEGIN
|
||
|
SELECT RAISE(FAIL, "Debt must be initially unpaid")
|
||
|
WHERE NEW.paid <> 0;
|
||
|
END;
|
||
|
|