Documentation ¶
Overview ¶
Package source facilitates reading (and generating) migration source files.
Index ¶
Constants ¶
View Source
const RequiredMigrationsFile = "required.txt"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct { // Path is the path of the file. Path string // Name is the name of the migration, derived from the file name. Name string // Version is the numeric version of the migration, derived from the // file name and used to sort the migrations. Version int // contains filtered or unexported fields }
Migration is a handle to a migration source file.
func (*Migration) ReadStatements ¶
ReadStatements reads the migration file and parses it into individual statements.
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source is handle to a directory containing migration source files.
func NewFromPath ¶
NewFromPath creates a new Source from the provided path, or returns an error if the path does not exist.
func (*Source) FindMigrations ¶
FindMigrations finds all migrations under the source path.
func (*Source) GetRequiredMigrations ¶
GetRequiredMigrations gets a list of all migrations that should have been applied.
Click to show internal directories.
Click to hide internal directories.