migration

package
v6.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCouldNotParseDirection = errors.New("could not parse direction for migration")

Functions

func Asset

func Asset(string) ([]byte, error)

func AssetDir

func AssetDir(string) ([]string, error)

func AssetInfo

func AssetInfo(string) (os.FileInfo, error)

func AssetNames

func AssetNames() []string

func MustAsset

func MustAsset(string) []byte

func RestoreAsset

func RestoreAsset(string, string) error

func RestoreAssets

func RestoreAssets(string, string) error

Types

type Bindata

type Bindata interface {
	AssetNames() []string
	Asset(name string) ([]byte, error)
}

type Migrator

type Migrator interface {
	CurrentVersion() (int, error)
	SupportedVersion() (int, error)
	Migrate(version int) error
	Up() error
	Migrations() ([]migration, error)
}

func NewMigrator

func NewMigrator(db *sql.DB, lockFactory lock.LockFactory, strategy encryption.Strategy) Migrator

func NewMigratorForMigrations

func NewMigratorForMigrations(db *sql.DB, lockFactory lock.LockFactory, strategy encryption.Strategy, bindata Bindata) Migrator

type OpenHelper

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

func NewOpenHelper

func NewOpenHelper(driver, name string, lockFactory lock.LockFactory, strategy encryption.Strategy) *OpenHelper

func (*OpenHelper) CurrentVersion

func (self *OpenHelper) CurrentVersion() (int, error)

func (*OpenHelper) MigrateToVersion

func (self *OpenHelper) MigrateToVersion(version int) error

func (*OpenHelper) Open

func (self *OpenHelper) Open() (*sql.DB, error)

func (*OpenHelper) OpenAtVersion

func (self *OpenHelper) OpenAtVersion(version int) (*sql.DB, error)

func (*OpenHelper) SupportedVersion

func (self *OpenHelper) SupportedVersion() (int, error)

type Parser

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

func NewParser

func NewParser(bindata Bindata) *Parser

func (*Parser) ParseFileToMigration

func (p *Parser) ParseFileToMigration(migrationName string) (migration, error)

func (*Parser) ParseMigrationFilename

func (p *Parser) ParseMigrationFilename(fileName string) (migration, error)

type Strategy

type Strategy int
const (
	GoMigration Strategy = iota
	SQLTransaction
	SQLNoTransaction
)

Directories

Path Synopsis
cli
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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