Skip to content

Commit

Permalink
Merge pull request #53 from jelhan/fixes-52
Browse files Browse the repository at this point in the history
Fixes #52
  • Loading branch information
particlebanana committed Jun 6, 2016
2 parents de8ed6f + 064c744 commit 149a481
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,11 @@ Database.prototype.enforceUniqueness = function(collectionName, values, pkValueO
// (they shouldn't have been stored anyway)
if (_.isUndefined(values[attrName])) continue;

// Ignore uniqueness check on null values
// null should be ignored in unique constraint following SQL:2011 standard
// even so some DBMS (eg. Microsoft SQL Server) are not standard compliant
if (_.isNull(values[attrName])) continue;

This comment has been minimized.

Copy link
@mikermcneil

mikermcneil Aug 9, 2016

Member

@jelhan thanks!


// If `pkValueOfFirstRecordInResultSet` was provided, this must be an update,
// and we're updating the record with this pk value.
// e.g. if I'm updating record w/ id=3 to have email='foo@foo.com',
Expand Down

0 comments on commit 149a481

Please sign in to comment.