cosmos-sdk/core/appmodule/migrations.go
Julien Robert e15a0de251
feat(core): add migrations registering (#19370)
Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com>
2024-02-09 09:30:39 +00:00

17 lines
724 B
Go

package appmodule
import "context"
type MigrationRegistrar interface {
// Register registers an in-place store migration for a module. The
// handler is a migration script to perform in-place migrations from version
// `fromVersion` to version `fromVersion+1`.
//
// EACH TIME a module's ConsensusVersion increments, a new migration MUST
// be registered using this function. If a migration handler is missing for
// a particular function, the upgrade logic (see RunMigrations function)
// will panic. If the ConsensusVersion bump does not introduce any store
// changes, then a no-op function must be registered here.
Register(moduleName string, fromVersion uint64, handler func(context.Context) error) error
}