From 85a27c357295d01be5c66bf33ae93c1bbd239439 Mon Sep 17 00:00:00 2001 From: Geoffroy Empain Date: Fri, 29 Mar 2024 11:05:12 +0100 Subject: [PATCH] fix(inventory): cannot migrate existing products (#6877) (#6878) * fix(inventory): cannot migrate existing products (#6877) * chore: add changeset (#6821) --------- Co-authored-by: Geoffroy Empain Co-authored-by: Stevche Radevski --- .changeset/kind-feet-shake.md | 5 +++++ packages/medusa/src/scripts/migrate-inventory-items.ts | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/kind-feet-shake.md diff --git a/.changeset/kind-feet-shake.md b/.changeset/kind-feet-shake.md new file mode 100644 index 0000000000..9afd8791c0 --- /dev/null +++ b/.changeset/kind-feet-shake.md @@ -0,0 +1,5 @@ +--- +"@medusajs/medusa": patch +--- + +Fix logging error when trying to migrate products for enabling inventory module. diff --git a/packages/medusa/src/scripts/migrate-inventory-items.ts b/packages/medusa/src/scripts/migrate-inventory-items.ts index 33574412cc..e14fd9d23c 100644 --- a/packages/medusa/src/scripts/migrate-inventory-items.ts +++ b/packages/medusa/src/scripts/migrate-inventory-items.ts @@ -134,7 +134,7 @@ const migrate = async function ({ directory }) { await processBatch(variants, defaultLocationId, container) let processedCount = variants.length - Logger.log(`Processed ${processedCount} of ${totalCount}`) + Logger.info(`Processed ${processedCount} of ${totalCount}`) while (processedCount < totalCount) { const nextBatch = await variantService.list( {}, @@ -148,10 +148,10 @@ const migrate = async function ({ directory }) { await processBatch(nextBatch, defaultLocationId, container) processedCount += nextBatch.length - Logger.log(`Processed ${processedCount} of ${totalCount}`) + Logger.info(`Processed ${processedCount} of ${totalCount}`) } - Logger.log("Done") + Logger.info("Done") process.exit(0) }