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

@@ -82,10 +82,10 @@ func processMigrationJob(
return result
}
preSqlQueries := job.PreSQL
preSqlQueries := job.TargetTable.PreSQL
if job.TruncateTarget {
truncateQuery := buildTruncateQuery(targetDbType, job.TargetTable.Schema, job.TargetTable.Table, job.TruncateMethod)
preSqlQueries = append([]string{truncateQuery}, job.PreSQL...)
preSqlQueries = append([]string{truncateQuery}, job.TargetTable.PreSQL...)
}
for _, query := range preSqlQueries {
@@ -238,7 +238,7 @@ func processMigrationJob(
cancel()
}()
for _, query := range job.PostSQL {
for _, query := range job.TargetTable.PostSQL {
if _, err := targetDbWrapper.Exec(localCtx, query); err != nil {
result.Error = err
return result