docs: replace usages of migrations and links commands (#8894)
This commit is contained in:
@@ -111,7 +111,7 @@ So, add the following script in `package.json`:
|
||||
```json
|
||||
"scripts": {
|
||||
// ...
|
||||
"predeploy": "medusa migrations run && medusa links sync"
|
||||
"predeploy": "medusa db:migrate"
|
||||
},
|
||||
```
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ You can create a B2B module that adds necessary data models to represent a B2B c
|
||||
You can now run migrations with the following commands:
|
||||
|
||||
```bash npm2yarn
|
||||
npx medusa migrations run
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
### Add Create Company API Route
|
||||
|
||||
@@ -166,10 +166,10 @@ export const restockModelHighlights = [
|
||||
})
|
||||
```
|
||||
|
||||
You can now run the module's migrations with the following command:
|
||||
You can now run the migrations with the following command:
|
||||
|
||||
```bash npm2yarn
|
||||
npx medusa migrations run
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
### Create Restock Notification API Route
|
||||
|
||||
@@ -264,21 +264,15 @@ This defines a link between `DigitalProductOrder` and the Order Module’s `Orde
|
||||
To create tables for the digital product data models in the database, start by generating the migrations for the Digital Product Module with the following command:
|
||||
|
||||
```bash
|
||||
npx medusa migrations generate digitalProductModuleService
|
||||
npx medusa db:generate digitalProductModuleService
|
||||
```
|
||||
|
||||
This generates a migration in the `src/modules/digital-product/migrations` directory.
|
||||
|
||||
Then, reflect the migrations in the database with the following command:
|
||||
Then, reflect the migrations and links in the database with the following command:
|
||||
|
||||
```bash
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
Next, to reflect your links in the database, run the `links sync` command:
|
||||
|
||||
```bash
|
||||
npx medusa links sync
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -409,22 +409,16 @@ This defines a link between the Delivery Module’s `delivery` data model and th
|
||||
To create tables for the above data models in the database, start by generating the migrations for the Restaurant and Delivery Modules with the following commands:
|
||||
|
||||
```bash
|
||||
npx medusa migrations generate restaurantModuleService
|
||||
npx medusa migrations generate deliveryModuleService
|
||||
npx medusa db:generate restaurantModuleService
|
||||
npx medusa db:generate deliveryModuleService
|
||||
```
|
||||
|
||||
This generates migrations in the `src/modules/restaurant/migrations` and `src/modules/delivery/migrations` directories.
|
||||
|
||||
Then, to reflect the migration in the database, run the following command:
|
||||
Then, to reflect the migration and links in the database, run the following command:
|
||||
|
||||
```bash
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
Next, to reflect your links in the database, run the `links sync` command:
|
||||
|
||||
```bash
|
||||
npx medusa links sync
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -213,21 +213,15 @@ This adds a list link between the `Vendor` and `Order` data models, indicating t
|
||||
To create tables for the marketplace data models in the database, start by generating the migrations for the Marketplace Module with the following command:
|
||||
|
||||
```bash
|
||||
npx medusa migrations generate marketplaceModuleService
|
||||
npx medusa db:generate marketplaceModuleService
|
||||
```
|
||||
|
||||
This generates a migration in the `src/modules/marketeplace/migrations` directory.
|
||||
|
||||
Then, to reflect the migration in the database, run the following command:
|
||||
Then, to reflect the migration and links in the database, run the following command:
|
||||
|
||||
```bash
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
Next, to reflect your links in the database, run the `links sync` command:
|
||||
|
||||
```bash
|
||||
npx medusa links sync
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -252,21 +252,15 @@ This defines a list link to the `Order` data model since a subscription has mult
|
||||
To create a table for the `Subscription` data model in the database, start by generating the migrations for the Subscription Module with the following command:
|
||||
|
||||
```bash
|
||||
npx medusa migrations generate subscriptionModuleService
|
||||
npx medusa db:generate subscriptionModuleService
|
||||
```
|
||||
|
||||
This generates a migration in the `src/modules/subscriptions/migrations` directory.
|
||||
|
||||
Then, to reflect the migration in the database, run the following command:
|
||||
Then, to reflect the migration and links in the database, run the following command:
|
||||
|
||||
```bash
|
||||
npx medusa migrations run
|
||||
```
|
||||
|
||||
Next, to reflect your links in the database, run the `links sync` command:
|
||||
|
||||
```bash
|
||||
npx medusa links sync
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ npm run build
|
||||
3. Run migrations:
|
||||
|
||||
```bash
|
||||
npx medusa migrations run
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
4. Create an admin user:
|
||||
|
||||
@@ -6,10 +6,10 @@ export const metadata = {
|
||||
|
||||
If you run into errors after updating Medusa and its dependencies, it's highly recommended to check the Upgrade Guides if there is a specific guide for your version. These guides include steps required to perform after upgrading Medusa.
|
||||
|
||||
If there's no upgrade guide for your version, make sure that you ran the `migrations` command in the root directory of your Medusa application:
|
||||
If there's no upgrade guide for your version, make sure that you ran the `db:migrate` command in the root directory of your Medusa application:
|
||||
|
||||
```bash
|
||||
npx medusa migrations run
|
||||
npx medusa db:migrate
|
||||
```
|
||||
|
||||
This ensures your application has the latest database structure required. Then, try running your Medusa application again and check whether the same error occurs.
|
||||
|
||||
Reference in New Issue
Block a user