diff --git a/process/DuplicateScanner_lib/process.js b/process/DuplicateScanner_lib/process.js index 12420f6405cb18d5f9cb26dca6c86850f9df5380..b8f14e5ecaf139dbf64b8747adac1f6cc171481c 100644 --- a/process/DuplicateScanner_lib/process.js +++ b/process/DuplicateScanner_lib/process.js @@ -1107,12 +1107,11 @@ _DuplicateScannerUtils._migrateParticipantsToNewContact = function (pTableName, .where([pTableName, pContactIdColumn], pTargetContactId) .arrayColumn(); - var updateCount = newWhere([pTableName, pAssignableIdColumn], excludedIds, SqlBuilder.NOT_IN()) + var updateCount = newWhereIfSet([pTableName, pAssignableIdColumn], excludedIds, SqlBuilder.NOT_IN()) .and([pTableName, pContactIdColumn], pSourceContactId) .updateFields(new Map().set(pContactIdColumn, pTargetContactId), pTableName); - var deleteCount = newWhere([pTableName, pAssignableIdColumn], excludedIds, SqlBuilder.IN()) - .and([pTableName, pContactIdColumn], pSourceContactId) + var deleteCount = newWhere([pTableName, pContactIdColumn], pSourceContactId) .tableName(pTableName) .deleteData();