Files
medusa-store/docs/content/advanced/backend/upgrade-guides/1-7-3.md
Shahed Nasser c94ce03aa2 docs: added upgrade guide for 1.7.3 (#2968)
* docs: added upgrade guide for 1.7.3

* remove sales channel note
2023-01-11 17:36:29 +02:00

1.8 KiB
Raw Blame History

description
description
Actions Required for v.1.7.3

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 theyre now enabled by default. This requires running the necessary migrations to ensure your server works as expected.


Actions Required

Run Migrations

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

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, its strongly recommended to run a migration script before running the Medusa server.

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 server:

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