1 回答

TA貢獻(xiàn)1826條經(jīng)驗(yàn) 獲得超6個(gè)贊
您的電子郵件字段嵌套在姓名字段中
const Sequelize = require('sequelize')
const db = require('../db')
const Shoutout = db.define('shoutout', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER
}, //OLD
name: {
type: Sequelize.STRING,
validate: {
notEmpty: true
},
email: { # <----------------------------- nested too deep
type: Sequelize.STRING,
unique: true,
allowNull: false
}
},
message: {
type: Sequelize.TEXT,
allowNull: false
},
from: {
type: Sequelize.STRING
}
})
module.exports = Shoutout
添加回答
舉報(bào)