migrations

package
v0.0.0-...-96b04c8 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDatabaseDirty = fmt.Errorf("database is dirty")
	DefaultTable     = "schema_migrations"
)

Functions

This section is empty.

Types

type Config

type Config struct {
	MigrationsTable string
	DatabaseName    string
}

type Migration

type Migration struct {
	Version  int
	FileName string
}

type Migrations

type Migrations struct {
	Index      uintSlice
	Migrations map[int]Migration
}

type Mysql

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

func NewMysql

func NewMysql(url string) (*Mysql, error)

func (*Mysql) Close

func (m *Mysql) Close() error

func (*Mysql) Init

func (m *Mysql) Init() error

func (*Mysql) Run

func (m *Mysql) Run(migration io.Reader) error

func (*Mysql) SetVersion

func (m *Mysql) SetVersion(version int, dirty bool) error

func (*Mysql) Version

func (m *Mysql) Version() (version int, dirty bool, err error)

type SourceDriver

type SourceDriver struct {
	Dir string
}

func NewSourceDriver

func NewSourceDriver(dir string) (*SourceDriver, error)

func (SourceDriver) ReadUp

func (s SourceDriver) ReadUp(version int) (*Migrations, error)

Jump to

Keyboard shortcuts

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