How to add column in Sequelize existing model?

后端 未结 3 965
故里飘歌
故里飘歌 2021-02-08 09:00

I have added a model and a migration file using this command

node_modules/.bin/sequelize model:generate --name User --attributes firstName:string,lastName:strin         


        
3条回答
  •  独厮守ぢ
    2021-02-08 09:22

    In addition to @Suvethan Nantha's answer that just helped me by the way, ensure you wrap the queries in a Promise.all i.e return **Promise.all**([queryInterface.addColumn(...)]) so that it will return a promise, hence an error might be thrown. Cheers!

提交回复
热议问题