Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Fix issue were insert would break if the PK was a GUID due to the ada…
Browse files Browse the repository at this point in the history
…pter adding an SET IDENTITY_INSERT clause which should only be used with integer PKs
  • Loading branch information
Kelvin Del Monte committed Jul 14, 2016
1 parent f764cfb commit 789d1de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,11 @@ module.exports = (function () {
Object.keys(values).forEach(function(key) {
values[key] = utils.prepareValue(values[key]);
if (pk == key && pk == 'id') {
identityInsert = true;
//console.log(pk, '==', key);
var type = connections[connection].collections[collection].definition['id'].type;
if(type === 'number'){
identityInsert = true;
//console.log(pk, '==', key);
}
}
});
var schemaName = getSchemaName(connection, collection);
Expand Down

0 comments on commit 789d1de

Please sign in to comment.