migrator

package
v0.0.0-...-a757527 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBoxMigrator

func NewBoxMigrator(migrations *rice.Box, connectionString string) (*migrate.Migrate, error)

NewBoxMigrator returns an instance of migrate.Migrate wrapping migrations in the given rice.Box

Types

type Box

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

Box is a migrate driver

func NewBox

func NewBox(migrations *rice.Box) *Box

NewBox initializes a Box driver

func (*Box) Close

func (b *Box) Close() error

Close is a no-op

func (*Box) First

func (b *Box) First() (version uint, err error)

First returns the very first migration version available to the driver. Migrate will call this function multiple times.

func (*Box) Initialize

func (b *Box) Initialize() error

Initialize reads the rice-box for all migrations

func (*Box) Next

func (b *Box) Next(version uint) (nextVersion uint, err error)

Next returns the next version for a given version available to the driver. Migrate will call this function multiple times.

func (*Box) Open

func (b *Box) Open(url string) (source.Driver, error)

Open just throws an error, we need to use NewWithSourceInstance

func (*Box) Prev

func (b *Box) Prev(version uint) (prevVersion uint, err error)

Prev returns the previous version for a given version available to the driver. Migrate will call this function multiple times.

func (*Box) ReadDown

func (b *Box) ReadDown(version uint) (r io.ReadCloser, identifier string, err error)

ReadDown returns the DOWN migration body and an identifier that helps finding this migration in the source for a given version. If there is no down migration available for this version, it must return os.ErrNotExist.

func (*Box) ReadUp

func (b *Box) ReadUp(version uint) (r io.ReadCloser, identifier string, err error)

ReadUp returns the UP migration body and an identifier that helps finding this migration in the source for a given version. If there is no up migration available for this version, it must return os.ErrNotExist.

Jump to

Keyboard shortcuts

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