File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/db/src/util/migrator Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -425,6 +425,8 @@ export class StaticToCouchDBMigrator {
425425 const cleanDoc = { ...doc } ;
426426 // Remove _rev if present (CouchDB will assign new revision)
427427 delete cleanDoc . _rev ;
428+ // Remove _attachments - these are uploaded separately in Phase 5
429+ delete cleanDoc . _attachments ;
428430
429431 return cleanDoc ;
430432 } ) ;
@@ -575,10 +577,14 @@ export class StaticToCouchDBMigrator {
575577 }
576578 }
577579
580+ // Get current document revision (needed for putAttachment)
581+ const doc = await db . get ( docId ) ;
582+
578583 // Upload to CouchDB
579584 await db . putAttachment (
580585 docId ,
581586 attachmentName ,
587+ doc . _rev ,
582588 attachmentData as any , // PouchDB accepts both ArrayBuffer and Buffer
583589 attachmentMeta . content_type
584590 ) ;
You can’t perform that action at this time.
0 commit comments