migrations

package
v1.0.4-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingMigrationCode = errors.New("missing migration code for target schema version")
	ErrInvalidSchemaVersion = errors.New("invalid schema version")
)

Functions

This section is empty.

Types

type Migration

type Migration struct {
	Contract *coreutil.ContractInfo
	Apply    func(contractState kv.KVStore, log *logger.Logger) error
}

type MigrationScheme

type MigrationScheme struct {
	BaseSchemaVersion isc.SchemaVersion
	Migrations        []Migration
}

func (*MigrationScheme) LatestSchemaVersion

func (m *MigrationScheme) LatestSchemaVersion() isc.SchemaVersion

func (*MigrationScheme) WithTargetSchemaVersion

func (m *MigrationScheme) WithTargetSchemaVersion(v isc.SchemaVersion) (*MigrationScheme, error)

WithTargetSchemaVersion returns a new MigrationScheme where all migrations that correspond to a schema version newer than v are removed. This is necessary in order to replay old blocks without applying the newer migrations.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL