github medusajs/medusa v2.1.1

latest releases: v2.1.3, medusa-dev-cli@2.1.3, create-medusa-app@2.1.3...
11 days ago

Highlights

Shipping option rules

We've introduced support for pricing rules on shipping options. Initially, the feature allows you to define prices based on the cart item total. For example, you could have a free shipping option that is only available when the item total is above 100 EUR.

Every time the cart is updated, e.g. with new items, we refresh the shipping methods to ensure the correct price is applied at all times.

You'll find the new setting in the admin dashboard under "Settings > Locations & Shipping > View details > Edit prices (on shipping option)".

New languages

Our admin dashboard has been translated into Japanese.

DML Migrations

Warning

Schema changes

We've migrated our Cart, Sales Channel, API Key, Store, Workflow Engine, and Locking modules to use our Data Model API. These migrations include minor changes to the database schema, primarily around renaming indexes to respect our autogenerated naming conventions.

Read more about each of the schema changes in the PRs below.

Changes to hasOne

As part of our DML work, the behavior of hasOne has been updated in use cases where it is only defined on one side of the relation. In these cases, the mappedBy configuration of the hasOne definition needs to be set to undefined as it is not present on the other model.

For example:

const email = model.define("email", {
   email: model.text(),
   isVerified: model.boolean(),
 })

 const user = model.define("user", {
   id: model.number(),
   username: model.text(),
   email: model.hasOne(() => email, { mappedBy: undefined }), // <------------ Required config
 })

Required actions

Run migrations to ensure your server functions as expected after upgrading to v2.1.0:

npx medusa db:migrate

Features

Bugs

Documentation

Chores

Other Changes

New Contributors

Full Changelog: v2.1.0...v2.1.1

Don't miss a new medusa release

NewReleases is sending notifications on new releases.