Skip to content

Commit

Permalink
docs: documentation for "-c" connection option (typeorm#6080)
Browse files Browse the repository at this point in the history
Add documentantion for this typeorm#1333
  • Loading branch information
mateusppereira authored and Svetlozar committed Jan 12, 2021
1 parent 587977f commit 9241746
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/migrations.md
Original file line number Diff line number Diff line change
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 9241746

Please sign in to comment.