Skip to content

Commit 5b009dc

Browse files
bvt123claude
andcommitted
fix(model): Add MigrationOptions field to ChDestination
Add ChSinkMigrationOptions struct and MigrationOptions field to ChDestination to support automatic column addition during schema migration. This fixes the CI build failure in evolution tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ce6e761 commit 5b009dc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

pkg/providers/clickhouse/model/model_ch_destination.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ type ClickHouseColumnValueToShardName struct {
3333
ShardName string
3434
}
3535

36+
// ChSinkMigrationOptions controls schema migration behavior
37+
type ChSinkMigrationOptions struct {
38+
AddNewColumns bool `json:"AddNewColumns"` // When true, automatically add new columns from source to target
39+
}
40+
3641
var (
3742
_ model.Destination = (*ChDestination)(nil)
3843
_ model.Describable = (*ChDestination)(nil)
@@ -53,9 +58,10 @@ type ChDestination struct {
5358
HTTPPort int `log:"true"`
5459
NativePort int `log:"true"`
5560
TTL string `log:"true"`
56-
InferSchema bool `log:"true"`
57-
ConnectionID string `log:"true"`
58-
IsSchemaMigrationDisabled bool `log:"true"`
61+
InferSchema bool `log:"true"`
62+
MigrationOptions *ChSinkMigrationOptions `log:"true"`
63+
ConnectionID string `log:"true"`
64+
IsSchemaMigrationDisabled bool `log:"true"`
5965
// ForceJSONMode forces JSON protocol at sink:
6066
// - allows upload records without 'required'-fields, clickhouse fills them via defaults.
6167
// BUT IF THEY ARE 'REQUIRED' - WHAT THE POINT?

0 commit comments

Comments
 (0)