* 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:
2 files changed
+8
-3
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@medusajs/medusa": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fix logging error when trying to migrate products for enabling inventory module.
|
||||||
@@ -134,7 +134,7 @@ const migrate = async function ({ directory }) {
|
|||||||
await processBatch(variants, defaultLocationId, container)
|
await processBatch(variants, defaultLocationId, container)
|
||||||
|
|
||||||
let processedCount = variants.length
|
let processedCount = variants.length
|
||||||
Logger.log(`Processed ${processedCount} of ${totalCount}`)
|
Logger.info(`Processed ${processedCount} of ${totalCount}`)
|
||||||
while (processedCount < totalCount) {
|
while (processedCount < totalCount) {
|
||||||
const nextBatch = await variantService.list(
|
const nextBatch = await variantService.list(
|
||||||
{},
|
{},
|
||||||
@@ -148,10 +148,10 @@ const migrate = async function ({ directory }) {
|
|||||||
await processBatch(nextBatch, defaultLocationId, container)
|
await processBatch(nextBatch, defaultLocationId, container)
|
||||||
|
|
||||||
processedCount += nextBatch.length
|
processedCount += nextBatch.length
|
||||||
Logger.log(`Processed ${processedCount} of ${totalCount}`)
|
Logger.info(`Processed ${processedCount} of ${totalCount}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.log("Done")
|
Logger.info("Done")
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user