How to auto generate migrations with Sequelize CLI from Sequelize models?

前端 未结 10 1238
终归单人心
终归单人心 2020-11-29 16:52

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

10条回答
  •  感动是毒
    2020-11-29 17:33

    If you want to create model along with migration use this command:-

    sequelize model:create --name regions --attributes name:string,status:boolean --underscored
    

    --underscored it is used to create column having underscore like:- created_at,updated_at or any other column having underscore and support user defined columns having underscore.

提交回复
热议问题