From 7bc91f34e655d5955d266d179909198909346a40 Mon Sep 17 00:00:00 2001 From: xavi Date: Sat, 14 Sep 2024 20:00:59 -0700 Subject: [PATCH] Fixed dodo.schema to only check active tasks when assigning active id --- src/dodo.schema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;