AP1.12c: Reorder für Projekte und Backlog per sort_order.
Deploy Development / deploy (push) Successful in 45s
Test Suite / pytest-backend (push) Failing after 1m46s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped

Migration 015 für Backlog sort_order; DnD auf Desktop, Pfeile auf Mobile; PATCH-Batches für Geschwister.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-07-09 11:35:08 +02:00
1 parent e50c04c96f
commit a99d4a8974
15 files changed
+709 -130

No files matched your search

@@ -0,0 +1,21 @@
-- AP1.12c: Backlog sort_order für Reorder im Plan-Modus
ALTER TABLE backlog_items
ADD COLUMN IF NOT EXISTS sort_order INT NOT NULL DEFAULT 0;
WITH ranked AS (
SELECT
id,
(ROW_NUMBER() OVER (
PARTITION BY tenant_id, initiative_id
ORDER BY created_at ASC, id ASC
) - 1) * 10 AS next_order
FROM backlog_items
)
UPDATE backlog_items bi
SET sort_order = ranked.next_order
FROM ranked
WHERE bi.id = ranked.id;
CREATE INDEX IF NOT EXISTS idx_backlog_items_sort
ON backlog_items (tenant_id, initiative_id, sort_order);