Documentation
¶
Index ¶
Constants ¶
View Source
const CurrentPlanVersion = 1
Variables ¶
View Source
var ErrInvalidPlanVersion = errors.New("invalid plan version")
View Source
var (
ErrParse = fmt.Errorf("no match")
)
View Source
var Regex = regexp.MustCompile(`^([0-9]+)_(.*)\.(` + string(Down) + `|` + string(Up) + `)\.(.*)$`)
Regex matches the following pattern:
123_name.up.ext 123_name.down.ext
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct { Bytes []byte Name string RawName string Version uint32 Direction Direction }
func NewMigration ¶
func NewMigration(migrationBytes io.ReadCloser, fileName string) (*Migration, error)
type Plan ¶ added in v1.1.0
type Plan struct { // Version is the version of the plan. Version int // Auto is the mode of the plan. If true, the plan will rollback automatically in case of an error. Auto bool // Migrations is the list of migrations to be applied. Migrations []*Migration // RevertMigrations is the list of migrations to be applied in case of an error. RevertMigrations []*Migration }
Click to show internal directories.
Click to hide internal directories.