4
我发现我越来越SailsJS/MySQL的:在“字段列表”未知列“男”
Error (E_UNKNOWN) :: Encountered an unexpected error : ER_BAD_FIELD_ERROR: Unknown column 'NaN' in 'field list'
我第一次注意到这一点上分期(弹性魔豆)。然后当我做新鲜的npm install
时在本地注意到这一点。我怎样才能调试什么是错的?看来,
Survey.create(params)
是原因。但我想不通为什么... params
样子
{
"name": "ADDSW",
"description": "rewgre",
"url": "https://www.surveymonkey.com/r/my-survey-name?uid=[uid_value]&sid=[sid_value]",
"image": "https://s3-ap-southeast-1.amazonaws.com/meclub/savVD/35/zx.jpg",
"points": "111",
"trackingCode": "EN201510EXFABPSSADON",
"transaction_partner": "EX",
"transaction_department": "FAB",
"transaction_campaign": "ADON",
"win": ""
}
而且调查模型:
var shortid = require('shortid');
module.exports = {
autoPK: false,
attributes: {
id: {
type: 'string',
unique: true,
index: true,
primaryKey: true,
defaultsTo: function() {
return shortid.generate();
}
},
name: {
type: 'string',
required: true
},
description: {
type: 'string',
defaultsTo: ''
},
url: {
type: 'string',
required: true
},
image: {
type: 'string',
required: true
},
points: {
type: 'integer',
required: true
},
win: {
model: 'win'
},
trackingCode: {
type: 'string',
required: true
},
transaction_partner: {
type: 'string'
},
transaction_department: {
type: 'string'
},
transaction_campaign: {
type: 'string'
},
toJSON: function() {
var obj = this.toObject();
obj = _.omit(obj, ['createdAt', 'updatedAt', 'transaction_partner', 'transaction_department', 'transaction_campaign']);
return obj;
}
}
}
好像有些包导致错误?但我不能找出哪些...
UPDATE
刚试过在package.json
所以所有依赖安装在精确的版本删除的版本号的所有^
和~
,但它仍然失败...