migrate

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package migrate manage DB migrations.

Index

Constants

This section is empty.

Variables

View Source
var ErrDownNotSupported = errors.New("downgrade is not supported, restore from backup instead")

ErrDownNotSupported must be returned from goose Down function in case this migration does not support downgrade.

Functions

func Run

func Run(ctx Ctx, goose *goosepkg.Instance, dir string, command string, cfg *mysql.Config) error

Run executes goose command. It also enforce "fix" after "create".

func UpTo

func UpTo(ctx Ctx, goose *goosepkg.Instance, dir string, version int64, cfg *mysql.Config) (*schemaver.SchemaVer, error)

UpTo migrates up to a specific version.

Unlike goose.UpTo it will return error is current version doesn't match requested one after migration.

Types

type Ctx

type Ctx = context.Context

Ctx is a synonym for convenience.

Jump to

Keyboard shortcuts

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