我一直在閱讀大量的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.
我不希望覆蓋,使文件我認爲這不是正確的命令。這也讓我懷疑這是不可能的,必須在遷移文件級別進行調整。