Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

537
Visualizações
TypeORM CLI - How to run MIGRATIONS on a SPECIFIC DATABASE

My ormconfig.json has multiple DBs, how to run migrations for a SPECIFIC DB of this list? In the example below I have the dev db with migrations already set, now I need to set migrations for the other db called test.

I wanted to run a command like this:

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"
    }
  }
]
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Just run:

yarn typeorm migration:run -c configName where configName is the name of the configuration in your ormconfig.json db list.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda