Skip to content

Commit

Permalink
docs: documentation for "-c" connection option (#6080)
Browse files Browse the repository at this point in the history
Add documentantion for this #1333
  • Loading branch information
mateusppereira committed May 18, 2020
1 parent ed75d59 commit 3dc9ffd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/migrations.md
Expand Up @@ -4,6 +4,7 @@
* [Creating a new migration](#creating-a-new-migration)
* [Running and reverting migrations](#running-and-reverting-migrations)
* [Generating migrations](#generating-migrations)
* [Connection option](#connection-option)
* [Using migration API to write migrations](#using-migration-api-to-write-migrations)

## How migrations work
Expand Down Expand Up @@ -196,6 +197,12 @@ export class PostRefactoringTIMESTAMP implements MigrationInterface {
See, you don't need to write the queries on your own.
The rule of thumb for generating migrations is that you generate them after "each" change you made to your models.

## Connection option
If you need to run/revert your migrations for another connection rather than the default, use the `-c` (alias for `--connection`) and pass the config name as an argument
```
typeorm -c <your-config-name> migration:{run|revert}
```

## Using migration API to write migrations

In order to use an API to change a database schema you can use `QueryRunner`.
Expand Down

0 comments on commit 3dc9ffd

Please sign in to comment.