Fixed dodo.schema to only check active tasks when assigning active id

This commit is contained in:
xavi 2024-09-14 20:00:59 -07:00
parent b86ac43a25
commit 7bc91f34e6

View File

@ -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;