Documentation
¶
Index ¶
Constants ¶
View Source
const DateLayout = "20060102150405"
DateLayout is the date layout used to timestamp migrations.
View Source
const NamePattern = `[a-zA-Z0-9]([a-zA-Z0-9_-]*[a-zA-Z0-9])?`
NamePattern is the accepted regex pattern for a migration name (excluding timestamp prefix).
Variables ¶
View Source
var ( ErrWrongOrder = errors.New("migrate up section must appear before migrate down section") ErrMissingUpSection = errors.New("missing up section in migration file") )
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct {
Name string
Date time.Time
UpCmd *exec.Cmd
DownCmd *exec.Cmd
// contains filtered or unexported fields
}
Migration represents a single migration's file and state.
func New ¶
New makes a lazy initialisation of a Migration struct. Neither does it check if the file exists nor does it parse or validate its contents.
Click to show internal directories.
Click to hide internal directories.