Documentation
¶
Overview ¶
Package migration provides a "micro-framework" for migration management: each migration is a simple function that returns an error. All migration functions are executed in the order they were registered.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDuplicateMigration = errors.New("there's already a migration with this name")
ErrDuplicateMigration is the error returned by Register when the given name is already in use.
Functions ¶
func Register ¶
func Register(name string, fn MigrateFunc) error
Register register a new migration for later execution with the Run functions.
Types ¶
type MigrateFunc ¶
type MigrateFunc func() error
MigrateFunc represents a migration function, that can be registered with the Register function. Migrations are later ran in the registration order, and this package keeps track of which migrate have ran already.
Click to show internal directories.
Click to hide internal directories.