DEV Community

How to create and generate migrations in Typeorm 0.3+ with NestJS 9+

Andongwisye Mwamengo on October 10, 2023

Migration from Typeorm 0.2 to 0.3 has made changes in how to connect to the database and run migrations due to the fact that they deprecated ormcon...
Collapse
 
nerkn profile image
nerkn

Project I'm currently working expects name after generate

npm run migration:generate NewFeature
Enter fullscreen mode Exit fullscreen mode
Collapse
 
bennyxguo profile image
Benny Guo

This is the most up-to-date implemetation! Spend hours looking for this! Thanks!

Collapse
 
felipeboliveira profile image
Felipe Oliveira

What if i had multiple databases? Here we created an script because we couldn't make it work with datasources.

Collapse
 
eddie_mahmoud profile image
Mahmoud Eddie

Thank you

Collapse
 
kolynzb profile image
Atuhaire Collins

Thank you , you just saved my job

Collapse
 
__b33b481c3b profile image
Дмитрий Иванов

Thank you for your help, I didn’t find anything working in the official documentation and Github (maybe I didn’t look well :)) you helped a lot!