golang

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New added in v0.5.0

func New(source *m.GolangMigrationSource, updateVersion UpdateVersion, applied AppliedVersions) (m.Driver, error)

New creates a new Go migration driver. It requires a source a function for saving the executed migration version, a function for deleting a version that was migrated downwards, a function for listing all applied migrations and optionally a configuration.

Types

type AppliedVersions added in v0.5.0

type AppliedVersions func() ([]string, error)

AppliedVersions returns a list of applied versions and an error if something fails

type Driver added in v0.5.0

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

Driver is the golang migration.Driver implementation

func (*Driver) Close added in v0.5.0

func (g *Driver) Close() error

Close is the migration.Driver implementation of io.Closer

func (*Driver) Migrate added in v0.5.0

func (g *Driver) Migrate(migration *m.PlannedMigration) error

Migrate executes a planned migration

func (*Driver) Versions added in v0.5.0

func (g *Driver) Versions() ([]string, error)

Versions returns all applied migration versions

type UpdateVersion added in v0.5.0

type UpdateVersion func(id string, direction m.Direction) error

UpdateVersion takes an id and a direction and returns an error if something fails

Jump to

Keyboard shortcuts

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