feat: refactor migration job to use preSQL and postSQL from TargetTable; update config structure for job definitions

This commit is contained in:
2026-04-21 12:30:40 -05:00
parent bd51223855
commit 9964ef819b
3 changed files with 15 additions and 15 deletions

View File

@@ -33,15 +33,17 @@ type TableInfo struct {
Table string `yaml:"table"`
}
type TargetTableInfo struct {
TableInfo `yaml:",inline"`
}
type SourceTableInfo struct {
TableInfo `yaml:",inline"`
PrimaryKey string `yaml:"primary_key"`
}
type TargetTableInfo struct {
TableInfo `yaml:",inline"`
PreSQL []string `yaml:"pre_sql"`
PostSQL []string `yaml:"post_sql"`
}
type RangeConfig struct {
Min int64 `yaml:"min"`
Max int64 `yaml:"max"`
@@ -54,8 +56,6 @@ type Job struct {
Enabled bool `yaml:"enabled"`
SourceTable SourceTableInfo `yaml:"source"`
TargetTable TargetTableInfo `yaml:"target"`
PreSQL []string `yaml:"pre_sql"`
PostSQL []string `yaml:"post_sql"`
JobConfig `yaml:",inline"`
Range RangeConfig `yaml:"range"`
}