9
votes

I'm researching the ability to generate migration files for existing models. For example if I use "force: true" mode, tables in database are creating automatically so I can't believe that creating migrations files automatically is impossible. So could you help me with advice?

1
Do you want model files to be generated from existing database? - Prabhjot Singh Kainth
Prabhjot, no, I just wont to generate migration files from existing models with typescript - Steve Rock

1 Answers

0
votes

I was able to work around this by creating migrations using sequelize-cli in JS file and importing it in my TypeScript file.

This way only the migrations are in JS while the other parts are in TS