Feedback定义了三个属性
Feedback.init({
uid: { type: DataTypes.INTEGER },
content: { type: DataTypes.TEXT },
status: { type: DataTypes.ENUM('read', 'unread') },
})
在查询时莫名多出了一个id属性
Feedback.findAll({ where: { uid:3 } }
后端报错,错误的内容是说有一个未知的列:id
errno: 1054,
[0] sqlState: '42S22',
[0] sqlMessage: "Unknown column 'id' in 'field list'",
[0] sql: 'SELECT `id`, `uid`, `content`, `status` FROM `feedback` AS `FeedbackDao` WHERE `FeedbackDao`.`uid` = 3;',
[0] parameters: undefined
错误原因暂时没找到,但是在定义Feedback之后使用 Feedback.removeAttribute('id');删除掉这个id就可以用了