From eee4f06737f9051605ce511635545af877c0ba8a Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 11 May 2026 11:03:53 +0200 Subject: [PATCH] =?UTF-8?q?fix(documents):=20correct=200051=20migration=20?= =?UTF-8?q?header=20=E2=80=94=20backfill=20ships=20separately?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Header comment said the migration backfills the structure; it doesn't. Backfill is in scripts/backfill-document-folders.ts (Task 11) so the schema change can deploy first and the data work runs idempotently after. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/lib/db/migrations/0051_documents_hub_split.sql | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/db/migrations/0051_documents_hub_split.sql b/src/lib/db/migrations/0051_documents_hub_split.sql index c1c41f31..92501247 100644 --- a/src/lib/db/migrations/0051_documents_hub_split.sql +++ b/src/lib/db/migrations/0051_documents_hub_split.sql @@ -1,8 +1,10 @@ -- Wave 11.B+: documents hub split + auto-filed client folders. -- Adds system-managed folder lifecycle columns to document_folders --- (Clients/Companies/Yachts roots + per-entity subfolders), adds the --- folder_id pointer to files, and backfills the structure for every --- existing port + file. Idempotent — safe to re-run. +-- (Clients/Companies/Yachts roots + per-entity subfolders) and the +-- folder_id pointer to files. Backfill (ensureSystemRoots + per- +-- entity subfolders + files.folder_id from entity FKs) runs as a +-- separate deploy step — see scripts/backfill-document-folders.ts. +-- Idempotent — safe to re-run. -- ─── document_folders: lifecycle columns ────────────────────────────────── ALTER TABLE "document_folders"