Skip to content

Commit

Permalink
fix(inventory): cannot migrate existing products (#6877) (#6878)
Browse files Browse the repository at this point in the history
* fix(inventory): cannot migrate existing products (#6877)

* chore: add changeset (#6821)

---------

Co-authored-by: Geoffroy Empain <[email protected]>
Co-authored-by: Stevche Radevski <[email protected]>
  • Loading branch information
3 people authored Mar 29, 2024
1 parent 1c6ba44 commit 85a27c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-feet-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

Fix logging error when trying to migrate products for enabling inventory module.
6 changes: 3 additions & 3 deletions packages/medusa/src/scripts/migrate-inventory-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
{},
Expand All @@ -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)
}

Expand Down

0 comments on commit 85a27c3

Please sign in to comment.