fix(inventory): cannot migrate existing products (#6877) (#6878)

* fix(inventory): cannot migrate existing products (#6877)

* chore: add changeset (#6821)

---------

Co-authored-by: Geoffroy Empain <geoffroy@charlie-bravo.be>
Co-authored-by: Stevche Radevski <sradevski@live.com>
This commit is contained in:
Geoffroy Empain
2024-03-29 11:05:12 +01:00
committed by GitHub
parent 1c6ba4468e
commit 85a27c3572
2 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---
Fix logging error when trying to migrate products for enabling inventory module.

View File

@@ -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)
}