From df1a260bdc5649011f3c7ba6c459d3f1ae1959d7 Mon Sep 17 00:00:00 2001 From: kraanzu Date: Fri, 6 Dec 2024 08:27:49 +0530 Subject: [PATCH] fix: order index for new siblings --- dooit/api/hooks/fix_hooks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dooit/api/hooks/fix_hooks.py b/dooit/api/hooks/fix_hooks.py index 28f29e13..b4d9a687 100644 --- a/dooit/api/hooks/fix_hooks.py +++ b/dooit/api/hooks/fix_hooks.py @@ -16,7 +16,7 @@ def fix_order_id_workspace(mapper, connection, target: Workspace): connection.execute( text(""" UPDATE workspace - SET order_index = order_index + 1 + SET order_index = order_index WHERE order_index >= :current_index AND id != :target_id """), @@ -33,7 +33,7 @@ def fix_order_id_todo(mapper, connection, target: Todo): connection.execute( text(""" UPDATE todo - SET order_index = order_index + 1 + SET order_index = order_index WHERE order_index >= :current_index AND id != :target_id """),