Skip to content

Commit

Permalink
Minimize diff by reverting subset of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Sep 4, 2024
1 parent ce8b08d commit e74a6a6
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions cmd/soroban-rpc/internal/db/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,14 @@ func BuildMigrations(
}

//
// Add new migrations here:
// Add new DB migrations here:
//
currentMigrations := map[string]migrationApplierF{
transactionsMigrationName: newTransactionTableMigration,
eventsMigrationName: newEventTableMigration,
}

mm := MultiMigration{
migrations: make([]Migration, 0, len(currentMigrations)),
db: db,
}

migrations := make([]Migration, 0, len(currentMigrations))
for migrationName, migrationFunc := range currentMigrations {
migrationLogger := logger.WithField("migration", migrationName)
factory := migrationFunc(
Expand All @@ -237,8 +233,11 @@ func BuildMigrations(
continue
}

mm.Append(guardedM)
migrations = append(migrations, guardedM)
}

return mm, nil
return MultiMigration{
migrations: migrations,
db: db,
}, nil
}

0 comments on commit e74a6a6

Please sign in to comment.