Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StdLog = log.Printf
StdLog is the log.Printf function from the standard library
Functions ¶
This section is empty.
Types ¶
type Migrate ¶
type Migrate struct {
// contains filtered or unexported fields
}
Migrate manages database migrations
func New ¶
New creates a new Migrate with the given database and versions.
If the provided logger function is not `nil` additional information will be logged during the migrations apply or discard.
func NewWithFiles ¶
NewWithFiles is like new but takes a fs.Fs as a source for migration files. Only files within the 1st level of the provided path matching the `(\d+)_(\w+)\.(apply|discard)\.sql` pattern will be added to the Migrate catalog.
func (*Migrate) Apply ¶
Apply either rolls forward or backwards the migrations to the specified version
Click to show internal directories.
Click to hide internal directories.