Files
brain/db/migrations/006_bookmark_kanban_position.sql
T
Andrew S Erwin b9721ff13f
release gate / check (push) Failing after 8m35s
initial commit on Federted servers
2026-10-19 16:23:55 -05:00

9 lines
585 B
SQL

-- 006_bookmark_kanban_position.sql — persisted card ordering on kanban
-- boards. Every card move normalizes the target column's positions so a
-- drag inside a column survives reloads and concurrent moves stay
-- deterministic. Legacy rows default to 0 and keep their existing
-- updatedAt-descending order until the column is first arranged.
ALTER TABLE "Bookmark" ADD COLUMN IF NOT EXISTS "kanbanPosition" integer NOT NULL DEFAULT 0;
CREATE INDEX IF NOT EXISTS "Bookmark_ownerId_kanbanColumnId_kanbanPosition_idx"
ON "Bookmark"("ownerId","kanbanColumnId","kanbanPosition",id);