Merge pull request #25 from sra/master
updateOrCreate assumes numeric primary key(s)
This commit is contained in:
commit
a170621e1c
|
@ -213,11 +213,7 @@ MySQL.prototype.updateOrCreate = function (model, data, callback) {
|
|||
if (props[key] || mysql.id(model, key)) {
|
||||
var k = mysql.columnEscaped(model, key);
|
||||
var v;
|
||||
if (!mysql.id(model, key)) {
|
||||
v = mysql.toDatabase(props[key], data[key]);
|
||||
} else {
|
||||
v = data[key];
|
||||
}
|
||||
v = mysql.toDatabase(props[key], data[key]);
|
||||
if (v !== undefined) {
|
||||
fieldsNames.push(k);
|
||||
fieldValues.push(v);
|
||||
|
|
Loading…
Reference in New Issue