migrator

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirtyMigrationExists = fmt.Errorf("dirty migration")

Functions

This section is empty.

Types

type FSUtils

type FSUtils interface {
	GetMigrationFileList(migrationsDir string) (fsutils.DirElements, error)
	ReadFileContent(pathToFile string) (string, error)
}

type Service

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

func New

func New(logger *zap.Logger, store Store, migrationPath string, skipDownFiles bool) *Service

New returns a new migrator service

func (*Service) Close

func (s *Service) Close() (error, error)

func (*Service) Up

func (s *Service) Up() error

type Store

type Store interface {
	HasMigrationRun(filename string) (bool, error)
	InsertMigration(filename string) (model.Migration, error)
	RawExec(s string) error
	MarkMigrationCompleted(id uint) (model.Migration, error)
	EnsureMigrationTableExists() error
	GetLatestFailedMigration() (*model.Migration, error)
	Close() error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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