refactor: add validation feature to compare row counts between source and target databases
This commit is contained in:
@@ -22,6 +22,7 @@ func main() {
|
||||
checkExpiry()
|
||||
|
||||
configPath := flag.String("config", "", "path to migration config file")
|
||||
validate := flag.Bool("validate", false, "count rows in source and target per job and compare")
|
||||
flag.Parse()
|
||||
|
||||
if flag.NArg() > 1 {
|
||||
@@ -78,6 +79,12 @@ func main() {
|
||||
defer sourceDb.Close()
|
||||
defer targetDb.Close()
|
||||
|
||||
if *validate {
|
||||
validationResults := validateJobs(ctx, sourceDb, targetDb, migrationConfig.Jobs, migrationConfig.MaxParallelWorkers)
|
||||
printValidationReport(validationResults)
|
||||
return
|
||||
}
|
||||
|
||||
results := processMigrationJobs(ctx, sourceDb, targetDb, migrationConfig.Jobs, migrationConfig.MaxParallelWorkers)
|
||||
|
||||
log.Info("=== RESUMEN DE MIGRACIÓN ===")
|
||||
|
||||
Reference in New Issue
Block a user