migration

package
v0.0.0-...-59e56fa Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IDStore

type IDStore interface {
	GetID() string
	SetID(string)
}

IDStore interface for stores id in migrations

type Migration

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

Migration is a migration step.

func Begin

func Begin(appName string) *Migration

Begin with empty unique migration step.

func (*Migration) Exec

func (m *Migration) Exec(curr IDStore) error

Exec method run migrations chain in order

func (*Migration) Id

func (m *Migration) Id() string

ID is an uniq migration's id.

func (*Migration) IdChain

func (m *Migration) IdChain() []string

IdChain return list of migrations ids in chain

func (*Migration) Next

func (m *Migration) Next(name string, exec func() error) *Migration

Next creates next migration.

Jump to

Keyboard shortcuts

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