Help us shape the future of Go! Take the 2026 Go Developer Survey

migrate

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMigrationNeeded = errors.New("no migration needed")
View Source
var MigrationSteps []MigrationStep = []MigrationStep{{
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
}, {
	// contains filtered or unexported fields
},
}

Functions

func MakeSqliteDummyDB

func MakeSqliteDummyDB() *sqlx.DB

MakeSqliteDummyDB creates a Sqlite in-memory DB and migrates it to the current schema. It is to be used for testing purposes only.

Types

type MigrationStep

type MigrationStep struct {
	// contains filtered or unexported fields
}

MigrationStep represents a single migration step for host DB

type Migrator

type Migrator struct {
	Steps     []MigrationStep       `checkinject:"required"`
	Config    *domain.RuntimeConfig `checkinject:"required"`
	DBManager interface {
		GetHandle() *domain.DB
		GetSchema() string
		SetSchema(string) error
	} `checkinject:"required"`
}

Migrator manages the migration process

func (*Migrator) AppspaceMigrationRequired added in v0.14.0

func (m *Migrator) AppspaceMigrationRequired(to string) (bool, error)

func (*Migrator) LastStepName

func (m *Migrator) LastStepName() string

LastStepName returns the last (current) schema name

func (*Migrator) Migrate

func (m *Migrator) Migrate(to string) error

Migrate transforms the DB and anything else to match schema at "to" if to is "" it will migrate to the last step.

Jump to

Keyboard shortcuts

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