docs: fixes to plugin documentation (#2265)

* docs: fixes to plugins documentation

* added missing prepare step
This commit is contained in:
Shahed Nasser
2022-09-28 17:05:08 +03:00
committed by GitHub
parent 0ffc5b48d7
commit d03ff07a48
2 changed files with 74 additions and 40 deletions

View File

@@ -1,6 +1,6 @@
# How to Create Migrations
In this document, youll learn how to create a [Migration](overview.md) using [Typeorm](https://typeorm.io).
In this document, youll learn how to create a [Migration](overview.md) using [Typeorm](https://typeorm.io) on your Medusa server.
## Create Migration File
@@ -10,14 +10,10 @@ To create a migration that makes changes to your Medusa schema, run the followin
npx typeorm migration:create -n UserChanged --dir src/migrations
```
:::tip
The migration file must be inside the `src/migrations` directory. When the build command is run, it will be transpiled into the directory `dist/migrations`. The `migrations run` command can only pick up migrations under the `dist/migrations` directory.
:::
This will create the migration file in the path you specify. You can use this without the need to install Typeorm's CLI tool. You can then go ahead and make changes to it as necessary.
The migration file must be inside the `src/migrations` directory. When you run the build command, it will be transpiled into the directory `dist/migrations`. The `migrations run` command can only pick up migrations under the `dist/migrations` directory on a Medusa server. This applies to migrations created in a Medusa server, and not in a Medusa plugin. For plugins, check out the [Plugin's Structure section](../plugins/create.md).
:::tip
You can learn more about writing migrations in [Typeorms Documentation](https://typeorm.io/migrations).