diff --git a/internal/postgres/user.go b/internal/postgres/user.go index 921af51..10b343c 100644 --- a/internal/postgres/user.go +++ b/internal/postgres/user.go @@ -70,7 +70,7 @@ func CreateUserNodeWithSourceRelation(ctx context.Context, db *gorm.DB, anthrove AccountID: userID, } - if err := db.WithContext(ctx).Create(&userSource).Error; err != nil { + if err := db.WithContext(ctx).FirstOrCreate(&userSource).Error; err != nil { log.WithFields(log.Fields{ "anthrove_user_id": anthroveUserID, "source_domain": sourceDomain,