2

I'm wanting to generate migration files for /models/model_name.js (model) files. Although I haven't found a way todo this yet.

So say I created a model articles with just an id field, and then I edited that models/articles.jsfile, how can I use the sequelize cli to generate a migration file, so I can then update my database structure?!

James111
  • 15,378
  • 15
  • 78
  • 121

2 Answers2

0

There is currently no way to auto-generate Sequelize.js model migrations. See this question and its answers also: How to auto generate migrations with Sequelize CLI from Sequelize models?.

Community
  • 1
  • 1
Steffen Langer
  • 1,141
  • 1
  • 12
  • 16
0

Install this npm:

Sequelize-mig

pretty updated and new

Install it with:

npm install sequelize-mig -g / yarn global add sequelize-mig

You can use it like this

sequelize-mig migration:make -n <migration name>

and it will generate the migration file by reading your changes and comparing them

MRVMV
  • 142
  • 1
  • 7