diff --git a/src/dodo.schema b/src/dodo.schema index 88ac3be..a62c708 100644 --- a/src/dodo.schema +++ b/src/dodo.schema @@ -18,7 +18,7 @@ CREATE TABLE tasks( CREATE TRIGGER autoinc_active_id AFTER INSERT ON tasks BEGIN - UPDATE tasks SET active_id = (SELECT COALESCE((SELECT MAX(active_id) FROM tasks) + 1, 1)) WHERE task_id=NEW.task_id; + UPDATE tasks SET active_id = (SELECT COALESCE((SELECT MAX(active_id) FROM tasks WHERE active_id!='NULL') + 1, 1)) WHERE task_id=NEW.task_id; END;