docs: replace usages of migrations and links commands (#8894)

This commit is contained in:
Shahed Nasser
2024-08-30 11:48:49 +03:00
committed by GitHub
parent 9b6c2e5efa
commit 8c82207a41
12 changed files with 39 additions and 51 deletions
+1 -1
View File
@@ -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 Modules `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 Modules `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
```
---