v1.12.0
Version 1.12.0 of Medusa comes with database changes that require you run the migrations command and a minor breaking change to the PriceSelectionStrategy
.
Overview
This release contains migrations that introduce a range of new database indexes that will improve performance of your setup.
Additionally, it brings minor breaking changes to the PriceSelectionStrategy
. The method calculateVariantPrice
now supports bulk calculating variant prices.
Specifically, the following signature has changed:
Finally, a clean up of our @medusajs/utils
have also led to potential breaking changes. The clean-up resulted in the following:
The packages
class-validator
andclass-transformer
have been removed from@medusajs/utils
.The
TransactionBaseService
has been removed from@medusajs/utils
. This class should be imported from@medusajs/medusa
.The utilities
build-query
,db-aware-column
,base-entity
, andsoft-deletable-entity
have been removed from@medusajs/medusa
. These should be imported from @medusajs/medusa.
How to Update
Run the following command in the root directory of your Medusa Backend:
To avoid unexpected issues with dependencies, it is also recommended to update all other Medusa plugins or packages you have installed.
Actions Required
Run Migrations
After updating your Medusa server and before running it, run the following command to run the latest migrations:
Change PriceSelectionStrategy method
If you've created a custom price selection strategy, or have using the PriceSelectionStrategy
's calculateVariantPrice
method in your custom code, make sure to update its definition or usage based on the new signature:
You can learn more in the Price Selection Strategy documentation.