I have a set of Sequelize models. I want to use migrations, not DB Sync.
Sequelize CLI seems to be able to do this, according to this article: \"When you use the CLI
I created a small working "migration file generator". It creates files which are working perfectly fine using sequelize db:migrate
- even with foreign keys!
You can find it here: https://gist.github.com/manuelbieh/ae3b028286db10770c81
I tested it in an application with 12 different models covering:
STRING, TEXT, ENUM, INTEGER, BOOLEAN, FLOAT as DataTypes
Foreign key constraints (even reciprocal (user belongsTo team, team belongsTo user as owner))
Indexes with name
, method
and unique
properties