Skip to content

Commit 2ccbf91

Browse files
committed
fix: during replace use id column name if present
1 parent 7464c9d commit 2ccbf91

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/ibmdb.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,9 @@ IBMDB.prototype._replace = function(model, where, data, options, callback) {
584584

585585
if (err) return cb(err);
586586

587-
data[idName] = selectData[0][idName];
587+
// need to use column name (if available)
588+
// when obtaining value from 'selectData'
589+
data[idName] = selectData[0][self.idColumn(model)];
588590
stmt = self.buildInsert(model, data);
589591

590592
connection.query(stmt, function(err, sData) {

0 commit comments

Comments
 (0)