feat(migration): backfill story/task sort_order from code numeric suffix
One-time Prisma migration that sets sort_order = trailing numeric part of code for all existing stories and tasks, consistent with parseCodeNumber (fallback = Number.MAX_SAFE_INTEGER for non-conforming codes). PBIs are intentionally excluded. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
631d5e679c
commit
3a5aba2824
1 changed files with 15 additions and 0 deletions
|
|
@ -0,0 +1,15 @@
|
||||||
|
-- Backfill story/task sort_order from trailing numeric part of code.
|
||||||
|
-- Consistent with parseCodeNumber: no trailing digits → Number.MAX_SAFE_INTEGER (9007199254740991).
|
||||||
|
-- PBIs are intentionally excluded (they keep drag-and-drop + priority ordering).
|
||||||
|
|
||||||
|
UPDATE "stories"
|
||||||
|
SET sort_order = COALESCE(
|
||||||
|
CAST(SUBSTRING(code FROM '[0-9]+$') AS DOUBLE PRECISION),
|
||||||
|
9007199254740991
|
||||||
|
);
|
||||||
|
|
||||||
|
UPDATE "tasks"
|
||||||
|
SET sort_order = COALESCE(
|
||||||
|
CAST(SUBSTRING(code FROM '[0-9]+$') AS DOUBLE PRECISION),
|
||||||
|
9007199254740991
|
||||||
|
);
|
||||||
Loading…
Add table
Add a link
Reference in a new issue