migration

package
v4.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 15 Imported by: 22 modules, 69 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

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