migrator

package
v0.0.0-...-91dbb5c Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMigrationsBadType = errors.New("migrations must be slice of struct")
)

Functions

func CreateNewMigration

func CreateNewMigration(dir string, names ...string) (path string, err error)

func CreateNewMigrationFromModels

func CreateNewMigrationFromModels(dir string, models ...interface{}) (path string, err error)

Types

type Migrator

type Migrator struct {
	Scope  string
	DB     db.DB
	Logger logger.Logger
	// contains filtered or unexported fields
}

func (*Migrator) CanonicalScope

func (m *Migrator) CanonicalScope() string

func (*Migrator) Migrate

func (m *Migrator) Migrate() (err error)

func (*Migrator) Rollback

func (m *Migrator) Rollback() (err error)

func (*Migrator) SetMigrations

func (m *Migrator) SetMigrations(migrations interface{}) error

Jump to

Keyboard shortcuts

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