Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
Typeorm crea un archivo de migración en la raíz

Estoy generando migraciones usando TypeOrm en NestJS, pero no sé por qué crea el archivo de migración en la raíz cada vez y quiero que cree automáticamente el archivo de migración en la carpeta /src/server/migration/ .

ormconfig.ts

 import * as dotenv from 'dotenv'; import { DataSource } from 'typeorm'; dotenv.config(); const connection = new DataSource({ type: 'postgres' as const, host: 'localhost', port: 5432, username: 'username', password: 'password', database: 'database', entities: ['src/server/entity/*.{ts,js}'], migrations: ['src/server/migration/*.{ts,js}'], extra: { ssl: false, }, }); export default connection;

package.json

 { "scripts": { "typeorm": "typeorm-ts-node-esm --dataSource ./ormconfig.ts", "migration:gen": "npm run typeorm migration:generate -n", }, "dependencies": { "typeorm": "^0.3.6", } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

agregue la siguiente línea a su archivo ormconfig.ts:

 const connection = new DataSource({ ..... cli: { migrationsDir: "server/migration/" } ....
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!