From 92417462840ee33ff0c05c98c6a6313529eaeebd Mon Sep 17 00:00:00 2001 From: Mateus Pereira Date: Sun, 17 May 2020 23:23:54 -0300 Subject: [PATCH] docs: documentation for "-c" connection option (#6080) Add documentantion for this https://github.com/typeorm/typeorm/issues/1333 --- docs/migrations.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/migrations.md b/docs/migrations.md index a81db58271b..3cbd03f8ecd 100644 --- a/docs/migrations.md +++ b/docs/migrations.md @@ -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 @@ -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 migration:{run|revert} +``` + ## Using migration API to write migrations In order to use an API to change a database schema you can use `QueryRunner`.