From 9c3c8cb2f6ac046c7387d5bdb7646538696a25bf Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Wed, 17 Aug 2022 15:16:06 +0300 Subject: [PATCH] added upgrade guide for v1.3.6 --- .../advanced/backend/upgrade-guides/1-3-6.md | 39 +++++++++++++++++++ www/docs/sidebars.js | 5 +++ 2 files changed, 44 insertions(+) create mode 100644 docs/content/advanced/backend/upgrade-guides/1-3-6.md diff --git a/docs/content/advanced/backend/upgrade-guides/1-3-6.md b/docs/content/advanced/backend/upgrade-guides/1-3-6.md new file mode 100644 index 0000000000..240ba4cbc7 --- /dev/null +++ b/docs/content/advanced/backend/upgrade-guides/1-3-6.md @@ -0,0 +1,39 @@ +# v1.3.6 + +Following the addition of feature flags in version v1.3.3 and the addition of the Sales Channels API in v1.3.5, v1.3.6 introduces a data migration script that moves all products into the Default Sales Channel. + +:::note + +In version 1.3.6, Sales Channels are available but hidden behind feature flags. If you don’t have Sales Channels enabled, you don’t need to follow the steps detailed in this migration script. + +::: + +## Prerequisites + +Before performing the actions mentioned in this guide, you must set the following environment variables: + +```bash +TYPEORM_CONNECTION=postgres +TYPEORM_URL= +TYPEORM_LOGGING=true +TYPEORM_ENTITIES=./node_modules/@medusajs/medusa/dist/models/*.js +TYPEORM_MIGRATIONS=./node_modules/@medusajs/medusa/dist/migrations/*.js +``` + +These environment variables are used in the data migration scripts in this upgrade. Make sure to replace `` with your PostgreSQL database URL. + +## Sales Channels + +Sales Channels were introduced in v1.3.5 behind a feature flag. By enabling Sales Channels, developers and users can associate products and other entities with a specific Sales Channel. + +However, if you upgraded Medusa to v1.3.5 and enabled Sales Channels, you must add every product to at least one Sales Channel manually. Otherwise, products can’t be added to carts in different Sales Channels. + +v1.3.6 introduces a data migration script that automates this process for you by moving all your products into a default Sales Channel. This ensures that you can use the Sales Channels feature without it affecting the user experience in your store. + +### Actions Required + +If you’ve enabled Sales Channels, it’s essential to run the data migration script after upgrading your server and before starting your Medusa server: + +```bash +node ./node_modules/@medusajs/medusa/dist/scripts/sales-channels-migration.js +``` diff --git a/www/docs/sidebars.js b/www/docs/sidebars.js index 4c1941de5d..26576fe353 100644 --- a/www/docs/sidebars.js +++ b/www/docs/sidebars.js @@ -291,6 +291,11 @@ module.exports = { id: "advanced/backend/upgrade-guides/1-3-0", label: "v1.3.0" }, + { + type: "doc", + id: "advanced/backend/upgrade-guides/1-3-6", + label: "v1.3.6" + }, ] }, ]