BaseModel.updateOrCreate fails if criteria has numeric id but field is text/string
goliatone opened this issue · comments
goliatone commented
If we have defined our update payload with a numeric id:
{
"id": 1,
"name": "goliat"
}
And our model:
let User = {
attributes: {
id: {
type: 'text',
primaryKey: true,
unique: true,
}
};
The User.updateOrCreate
call will fail, since User.findOne({id:1})
will return null
but User.findOne({id:"1"})
will find the right record.