From 15c7f22663b59aa84f18f32176dd454c809323d7 Mon Sep 17 00:00:00 2001 From: briskt <3172830+briskt@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:04:44 +0800 Subject: [PATCH] allow a destination adapter to override the ID attribute --- internal/internal.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/internal.go b/internal/internal.go index a21a2fc..288b1df 100644 --- a/internal/internal.go +++ b/internal/internal.go @@ -134,6 +134,9 @@ func GenerateChangeSet(logger *log.Logger, sourcePeople, destinationPeople []Per if !personAttributesAreEqual(logger, sp, destinationPerson, config) { sp.ID = destinationPerson.Attributes["id"] + if destinationPerson.ID != "" { // use ID if it is set to something else + sp.ID = destinationPerson.ID + } changeSet.Update = append(changeSet.Update, sp) continue }