TypeORM migrations
Hi, Is there a way to run migrations with defining the connection as described in the docs?
export const databaseProviders = [
{
provide: DB_CON_TOKEN,
useFactory: async () => await createConnection({
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'root',
password: 'root',
database: 'test',
entities: [
__dirname + '/../**/*.entity{.ts,.js}',
],
migrations: [
__dirname + '/migrations/*.migration{.ts,.js}'
]
}),
},
];
The only option I see is to configure 2 dbConnections, one for nest (for the repository/entity) and one for TypeORM for the migrations.
Doesn't really have anything to do with Nest. What exists in the docs is just a simple example of how you could add TypeORM to a Nest server, it's far from the only way to do so.
There is a slightly more robust example here - https://github.com/zachgrayio/nest-typeorm-example
Note the database module used in conjunction with feature module specific TypeORM configs.
awesome! thanks for providing the example
I'm using TypeORM / Nest in prod @ work. You can find me in gitter under the same name if you continue to have trouble with it.
thanks @d3viant0ne ... I will :)
Example repo https://github.com/zachgrayio/nest-typeorm-example is 404ing right now.
@welkie https://github.com/kamilmysliwiec/nest-typeorm-example
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.