我一直在阅读大量的sequelize-cli文档,似乎无法弄清楚如何将列添加到现有模型中。我有一个模型叫,models/team.js
,想添加一个名为role_name
与sequelize model:create --name team --attributes role_name:string
模型列,但我收到一条消息覆盖而不是修改:Sequelize-CLI将列添加到现有模型
Loaded configuration file "config/config.json".
Using environment "development".
The file /Users/user/Desktop/Projects/node/app-repo/app/models/team.js already exists. Run "sequelize model:create --force" to overwrite it.
我不希望覆盖,使文件我认为这不是正确的命令。这也让我怀疑这是不可能的,必须在迁移文件级别进行调整。