feat: remove unused column type logging and streamline migration job processing
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/microsoft/go-mssqldb"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -20,7 +19,7 @@ var migrationJobs []MigrationJob = []MigrationJob{
|
||||
func main() {
|
||||
configureLog()
|
||||
log.Info("Starting migration...")
|
||||
log.Debugf("Migration jobs: %+v", migrationJobs)
|
||||
// log.Debugf("Migration jobs: %+v", migrationJobs)
|
||||
|
||||
sourceDb, targetDb, connError := connectToDatabases()
|
||||
if connError != nil {
|
||||
@@ -31,22 +30,9 @@ func main() {
|
||||
defer targetDb.Close()
|
||||
|
||||
for _, job := range migrationJobs {
|
||||
sourceColTypes, targetColTypes, err := GetColumnTypes(sourceDb, targetDb, job)
|
||||
if err != nil {
|
||||
log.Fatal("Unexpected error: ", err)
|
||||
}
|
||||
|
||||
logColumnTypes(sourceColTypes, "Source col types")
|
||||
logColumnTypes(targetColTypes, "Target col types")
|
||||
log.Infof("Processing job: %+v", job)
|
||||
processMigrationJob(sourceDb, targetDb, job)
|
||||
}
|
||||
|
||||
log.Info("Migration completed successfully!")
|
||||
}
|
||||
|
||||
func logColumnTypes(columnTypes []ColumnType, label string) {
|
||||
log.Info(label)
|
||||
|
||||
for _, col := range columnTypes {
|
||||
log.Infof("%+v", col)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user