docs: general fixes across documentation (#4248)
* docs: added details about the migration revert command * added a note about running postgres before the backend * added a link to typeorm's documentation * fix broken links * fixed section title * fixed admonitions
This commit is contained in:
@@ -90,7 +90,7 @@ npm run build
|
||||
The last step is to run the migration with the command detailed earlier
|
||||
|
||||
```bash
|
||||
medusa migrations run
|
||||
npx @medusajs/medusa-cli migrations run
|
||||
```
|
||||
|
||||
If you check your database now you should see that the change defined by the migration has been applied successfully.
|
||||
|
||||
@@ -25,16 +25,14 @@ Migrations are used to apply changes to the database schema. However, there are
|
||||
|
||||
---
|
||||
|
||||
## How to Run Migrations
|
||||
|
||||
Migrations in Medusa can be done in one of two ways:
|
||||
## Migration Commands
|
||||
|
||||
### Migrate Command
|
||||
|
||||
Using the Medusa CLI tool, you can run migrations with the following command:
|
||||
|
||||
```bash
|
||||
medusa migrations run
|
||||
npx @medusajs/medusa-cli migrations run
|
||||
```
|
||||
|
||||
This will check for any migrations that contain changes to your database schema that aren't applied yet and run them on your backend.
|
||||
@@ -46,10 +44,22 @@ Seeding is the process of filling your database with data that is either essenti
|
||||
You can use the following command to seed your database:
|
||||
|
||||
```bash npm2yarn
|
||||
npm run seed
|
||||
npx @medusajs/medusa-cli@latest seed -f ./data/seed.json
|
||||
```
|
||||
|
||||
This will use the underlying `seed` command provided by Medusa's CLI to seed your database with data from the file `data/seed.json` on your Medusa backend.
|
||||
This assumes that you have the file `data/seed.json` in your Medusa backend, which is available by default. It includes the demo data to seed into your database.
|
||||
|
||||
### Revert Migrations
|
||||
|
||||
To revert the last migration you ran, run the following command:
|
||||
|
||||
```bash
|
||||
npx @medusajs/medusa-cli@latest migrations revert
|
||||
```
|
||||
|
||||
### Other Migrations Commands
|
||||
|
||||
You can learn about migration commands available in the Medusa CLI tool by referring to the [Medusa CLI reference](../../../cli/reference.md#migrations)
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user