Mi ormconfig.json tiene varias bases de datos, ¿cómo ejecutar migraciones para una base de datos ESPECÍFICA de esta lista? En el siguiente ejemplo, tengo la dev de datos de desarrollo con migraciones ya configuradas, ahora necesito configurar las migraciones para la otra base de datos llamada test .
Quería ejecutar un comando como este:
yarn typeorm migration:run --database test
// ormconfig.json [ { "name": "dev", "type": "postgres", "host": "localhost", "port": 5432, "username": "postgres", "password": "postgres", "database": "postgres", "synchronize": true, "logging": true, "entities": ["src/typeorm/entity/**/*.ts"], "migrations": ["src/typeorm/migration/**/*.ts"], "subscribers": ["src/typeorm/subscriber/**/*.ts"], "cli": { "entitiesDir": "src/typeorm/entity", "migrationsDir": "src/typeorm/migration", "subscribersDir": "src/typeorm/subscriber" } }, { "name": "test", "type": "postgres", "host": "localhost", "port": 5433, "username": "postgres", "password": "postgres", "database": "postgres", "synchronize": true, "logging": false, "entities": ["src/typeorm/entity/**/*.ts"], "migrations": ["src/typeorm/migration/**/*.ts"], "subscribers": ["src/typeorm/subscriber/**/*.ts"], "cli": { "entitiesDir": "src/typeorm/entity", "migrationsDir": "src/typeorm/migration", "subscribersDir": "src/typeorm/subscriber" } } ]Solo corre:
yarn typeorm migration:run -c configName donde configName es el name de la configuración en su lista de base de ormconfig.json .