Skip to main content
Skip to main content

v1.7.3

Version 1.7.3 of Medusa changes the feature flag value for Sales Channels and Publishable API Keys.

Overview

Sales Channels and Publishable API Keys were introduced in previous versions of Medusa, but guarded by feature flags This meant that developers had to manually enable them to use them.

Version 1.7.3 of Medusa keeps the feature flags for these two features, but they’re now enabled by default. This requires running the necessary migrations to ensure your backend works as expected.


Actions Required

Run Migrations

After updating your Medusa backend and before running it, run the following command to run the latest migration:

npx medusa migrations run

Run Migration Script for Sales Channels

With the introduction of Sales Channels, products are now associated with them. To avoid inconsistencies with how products are linked to Sales Channels, it’s strongly recommended to run a migration script right after running the Medusa backend the first time.

Start by adding the following environment variables:

TYPEORM_CONNECTION=postgres
TYPEORM_URL=<DATABASE_URL>
TYPEORM_LOGGING=true
TYPEORM_ENTITIES=./node_modules/@medusajs/medusa/dist/models/*.js
TYPEORM_MIGRATIONS=./node_modules/@medusajs/medusa/dist/migrations/*.js

Make sure to replace <DATABASE_URL> with the connection URL of your database.

Then, run the following command in the root of your Medusa backend:

node ./node_modules/@medusajs/medusa/dist/scripts/sales-channels-migration.js

Disabling Feature Flags

Although this version enables Sales Channels and Publishable API Keys by default, you can still turn them off using feature flags. Learn more in this documentation

Was this section helpful?