diff --git a/internal/infrastructure/legacyimport/load.go b/internal/infrastructure/legacyimport/load.go index 4d5096601..127e367ac 100644 --- a/internal/infrastructure/legacyimport/load.go +++ b/internal/infrastructure/legacyimport/load.go @@ -23,6 +23,13 @@ var droppedColumns = map[string]bool{ "playbook_dispatches.id": true, } +// newColumns are target columns added after the legacy stores, with no +// legacy value to carry. Imported rows take the column default: an imported +// capture has no event type, so it stays unidentified and never dispatches. +var newColumns = map[string]bool{ + "captures.event_type": true, +} + // targetKeys override a table's legacy key where the target has no column // for it. var targetKeys = map[string][]string{ @@ -171,6 +178,7 @@ func plan(ctx context.Context, tx pgx.Tx, t legacyread.Table, problems *refusal) problems.add("%s: no target table", t.Name) } targetNames := map[string]bool{} + cols = slices.DeleteFunc(cols, func(c column) bool { return newColumns[t.Name+"."+c.name] }) for i := range cols { targetNames[cols[i].name] = true cols[i].source = slices.Index(t.Columns, cols[i].name)