From 31f64429bb79ad297e396ad8d8cd63bf7fd01bc5 Mon Sep 17 00:00:00 2001 From: Dana Fallon <8871189+danafallon@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:02:34 -0700 Subject: [PATCH] Fixes --- lib/cdc/util/relational_event.go | 4 ++-- lib/typing/columns/diff.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cdc/util/relational_event.go b/lib/cdc/util/relational_event.go index aeaac5988..77091d1e1 100644 --- a/lib/cdc/util/relational_event.go +++ b/lib/cdc/util/relational_event.go @@ -84,11 +84,10 @@ func (s *SchemaEventPayload) GetData(pkMap map[string]any, tc *kafkalib.TopicCon if err != nil { return nil, err } - retMap[constants.OnlySetDeletedColumnMarker] = false } else { retMap = make(map[string]any) - retMap[constants.OnlySetDeletedColumnMarker] = true } + retMap[constants.OnlySetDeletedColumnMarker] = true // This is a delete payload, so mark it as deleted. // And we need to reconstruct the data bit since it will be empty. // We _can_ rely on *before* since even without running replicate identity, it will still copy over @@ -109,6 +108,7 @@ func (s *SchemaEventPayload) GetData(pkMap map[string]any, tc *kafkalib.TopicCon return nil, err } retMap[constants.DeleteColumnMarker] = false + retMap[constants.OnlySetDeletedColumnMarker] = false } if tc.IncludeArtieUpdatedAt { diff --git a/lib/typing/columns/diff.go b/lib/typing/columns/diff.go index 6697e0718..f717bca1f 100644 --- a/lib/typing/columns/diff.go +++ b/lib/typing/columns/diff.go @@ -11,7 +11,7 @@ import ( // shouldSkipColumn takes the `colName` and `softDelete` and will return whether we should skip this column when calculating the diff. func shouldSkipColumn(colName string, softDelete bool, includeArtieUpdatedAt bool, includeDatabaseUpdatedAt bool, mode config.Mode) bool { // TODO: Figure out a better way to not pass in so many variables when calculating shouldSkipColumn - if (colName == constants.DeleteColumnMarker || colName == constants.OnlySetDeletedColumnMarker) && softDelete { + if colName == constants.DeleteColumnMarker && softDelete { // We need this column to be created if soft deletion is turned on. return false }