Documentation
¶
Overview ¶
Package migrate is used to write migrations between representations of things.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SupportNoRevert = map[string]bool{ "4-to-5": true, }
Functions ¶
func SplitVersion ¶
Types ¶
type Flags ¶
type Flags struct {
Force bool
Revert bool
Path string // file path to migrate for fs based migrations
Verbose bool
Help bool
NoRevert bool
}
func SetupFlags ¶
func SetupFlags() Flags
type Migration ¶
type Migration interface {
// Versions is the "v-to-v" version string.
Versions() string
// Reversible returns whether this migration can be reverted.
// Endeavor to make them all reversible. This is here only to warn users
// in case this is not the case.
Reversible() bool
// Apply applies the migration in question.
Apply(Options) error
// Revert un-applies the migration in question. This should be best-effort.
// Some migrations are definitively one-way. If so, return an error.
Revert(Options) error
}
Migration represents
Click to show internal directories.
Click to hide internal directories.