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
所以所有依賴安裝在精確的版本刪除的版本號的所有^
和~
,但它仍然失敗...