migration

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 5 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 KvdbIDStore

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

KvdbIDStore stores id

func NewKvdbIDStore

func NewKvdbIDStore(table kvdb.KeyValueStore) *KvdbIDStore

NewKvdbIDStore constructor

func (*KvdbIDStore) GetID

func (p *KvdbIDStore) GetID() string

GetID is a getter

func (*KvdbIDStore) SetID

func (p *KvdbIDStore) SetID(id string)

SetID is a setter

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) IDs

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

IDs 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