chore(migration): renumber 11 cases to canonical NNNN-MM-YY #221
Reference in New Issue
Block a user
Delete Branch "worktree-case-renumber-tool"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
מיגרציה חד-פעמית (בוצעה כבר 2026-06-12 על הייצור; ה-PR מתעד את הכלי).
מה נעשה
הוספת ספרות-חודש ל-11 מספרי-תיקים + תיקון-סידורי
1046-26→1024-02-26:למה כלי ולא עריכה-ב-UI
כל קשרי-ה-DB על
cases.id(UUID) → לא נשברים. מה שכן מוטבע כטקסט וטופל אטומית per-case (גיבוי ל-data/audit/+ אימות):cases.case_number+ כל עמודה עםcases/{old}/—file_pathוגםimage_thumbnail_path(מפתח-אחסון בלי/data→ needle בלי-סלאש)case.jsonlegal-immutable= WORM, copy-only (הישן נשאר נעול 7y)עקביות חוצת-קורפוס (4 הארכיב)
לתיקים שסופי שלהם הוטמע — המספר הקנוני הופץ לשדות-המזהה (
case_law.case_number,style_corpus/style_exemplars.decision_number×39,case_precedents.citation,digests.underlying_citation) בלבד. תוכן/full_text/OCR נשאר כרשומה היסטורית.אימות
0 אזכורים-תלויים בכל 11; מסמכים/thumbnails/טיוטות/Gitea/Paperclip נפתרים תחת המספרים החדשים;
case_lawהופץ לכל 4.Invariants
G1 (נרמול-במקור), G2 (אין מסלול-מקביל — pool+סמנטיקת-אחסון של האפליקציה), G12 (Paperclip רק דרך המשטח המוצהר).
🤖 Generated with Claude Code
One-time host migration (executed 2026-06-12): adds the missing 2-digit month to 11 case numbers (and corrects 1046-26 → 1024-02-26, a wrong serial). All legal-ai FKs are on cases.id (UUID) → untouched. The script atomically migrates, per case, everything that embeds the number as TEXT: · cases.case_number + every column containing 'cases/{old}/' (file_path AND image_thumbnail_path — the latter is a DATA_DIR-relative storage key with no '/data' prefix, hence the slash-less needle) · disk dir + case.json · MinIO keys across 3 buckets (legal-immutable = WORM, copy-only) · Gitea repo rename + local .git remote + description · Paperclip project name For the 4 archived cases whose final was ingested, the canonical number is propagated to the precedent + style corpora identifier fields (case_law, style_corpus, style_exemplars, citations) per chair decision — document content / full_text / OCR text is left as the historical record. Verified: 0 stale identifier/path refs across all 11; documents, thumbnails, drafts, Gitea, Paperclip all resolve under the new numbers. Per-case backups in data/audit/renumber-*.json. Invariants: G1 (normalise at source — single rename op, not read-time patch), G2 (no parallel path — reuses the app's DB pool + storage semantics), G12 (Paperclip touched only via its declared surface). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>