2017-02-21 22:24:27 +01:00
|
|
|
CREATE TRIGGER x_spentFromBeginning
|
2017-01-19 21:44:22 +01:00
|
|
|
BEFORE INSERT ON Credit
|
|
|
|
BEGIN
|
2017-02-22 21:58:47 +01:00
|
|
|
SELECT RAISE(ABORT, "credit must be initially unused")
|
2017-01-19 21:44:22 +01:00
|
|
|
WHERE NEW.spent != 0;
|
|
|
|
END;
|
|
|
|
|