用Sequelize做数据库映射的时候,服务端报错 Unrecognized data type for field age
发布于 6 年前 作者 a69694510 3265 次浏览 来自 问答

var Sequelize = require(‘sequelize’);

var sequelize = require(’./ModelHeader’);

var PetinfoModel = sequelize.define(‘petinfos’,{ id:{type:Sequelize.BIGINT,primaryKey:true}, uid:Sequelize.BIGINT, nickname:Sequelize.STRING, pettype:Sequelize.INTEGER, petsort:Sequelize.INTEGER, sex:Sequelize.TEXT(‘tiny’), age:Sequelize.INTERGER, introduce:Sequelize.STRING, updtime:Sequelize.DATE, createtime:Sequelize.DATE },{ timestamps:false, }); module.exports = PetinfoModel;

然后服务端报这个错误

throw new Error('Unrecognized data type for field ’ + name); ^ Error: Unrecognized data type for field age

我在网上查了,可这个错误出现的很少,什么情况

2 回复

age:Sequelize.INTERGER,

INTEGER

@blue0125 额。。。。。。。。。火眼金睛

回到顶部