sequelize model:create --name tasks --force --attributes "title:string,description:text, data_type:text, shift:str
ing, date:date, start_time:time, end_time:time, type:string, location:string, visible_to_helpers:date, reminders_to_helpers:integer, created_date:time, modifi
ed_date:time"我试过了。它正在工作,但它使用我想要的一些task_id的id创建了主键
但是当我试着这样做的时候,它给了我错误
equelize model:create --name tasks --force --attributes "task_id:{type:integer, primaryKey: true,autoIncrement:
true}, title:string,description:text, data_type:text, shift:string, date:date, start_time:time, end_time:time, type:string, location:string, visible_to_helpe
rs:date, reminders_to_helpers:integer, created_date:time, modified_date:time"并且在所有小写字母的情况下也不起作用
谢谢
下面是错误

发布于 2017-07-12 04:00:05
我也有同样的问题,我用一种简单的方式解决了它。创建模型后(就像您的第一个命令一样),它将id作为主键。因此,我更新了模型,将"something model“作为我的主键,并运行以下命令:
node_modules/.bin/sequelize db:migrate这对我很管用。以下是我遵循的指导原则的链接:
http://mherman.org/blog/2015/10/22/node-postgres-sequelize/#.WWUr49MrIsk
https://stackoverflow.com/questions/41931520
复制相似问题