Versions in this module Expand all Collapse all v4 v4.16.0 Jan 14, 2022 Changes in this version + var DefaultParse = Parse + var DefaultRegex = Regex + var ErrParse = fmt.Errorf("no match") + var MgrFunctions = make(map[string]MigrationFunc) + var Regex = regexp.MustCompile(`^([0-9]+)_(.*)\.(` + string(Down) + `|` + string(Up) + `)\.(.*)$`) + func List() []string + func Register(name string, driver Driver) + func RegisterFuncMigration(fn MigrationFunc) + type Direction string + const Down + const Up + type Driver interface + Close func() error + First func() (version uint, err error) + MarkSkipMigrations func(version uint, dir Direction) + Next func(version uint) (nextVersion uint, err error) + Open func(url string) (Driver, error) + Prev func(version uint) (prevVersion uint, err error) + PrintSummary func(dir Direction) + ReadDown func(version uint) (r io.ReadCloser, identifier string, location string, fn MigrationFunc, ...) + ReadUp func(version uint) (r io.ReadCloser, identifier string, location string, fn MigrationFunc, ...) + UpdateStatus func(version uint, status Status, errstr string) + func Open(url string) (Driver, error) + type ErrDuplicateMigration struct + func (e ErrDuplicateMigration) Error() string + type Migration struct + Direction Direction + Error string + Identifier string + Raw string + Status Status + Version uint + func Parse(raw string) (*Migration, error) + type MigrationFunc func(ctx context.Context, db interface{}) error + type Migrations struct + func NewMigrations() *Migrations + func (i *Migrations) Append(m *Migration) (ok bool) + func (i *Migrations) Down(version uint) (m *Migration, ok bool) + func (i *Migrations) First() (version uint, ok bool) + func (i *Migrations) MarkSkipMigrations(version uint, dir Direction) + func (i *Migrations) Next(version uint) (nextVersion uint, ok bool) + func (i *Migrations) Prev(version uint) (prevVersion uint, ok bool) + func (i *Migrations) PrintSummary(dir Direction) + func (i *Migrations) Up(version uint) (m *Migration, ok bool) + func (i *Migrations) UpdateStatus(version uint, status Status, errstr string) + type Status string + const Done + const Failed + const Pending + const Skipped Other modules containing this package github.com/nokia/migrate