Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeMigrationHash ¶
ComputeMigrationHash computes the md5 hash of a migration file
Types ¶
type File ¶
File is used to parse a database manifest: a single ordered list of every migration in the database, each entry a "{directory}/{filename}" path. This is the total ordering of the database's migrations.
type FileLoader ¶
FileLoader loads a file and returns bytes.
type Migration ¶
type Migration struct {
Directory string `db:"directory"`
Filename string `db:"filename"`
Hash string `db:"hash"`
ExecutionTimestamp time.Time `db:"execution_timestamp"`
SQLQuery string
ExpectedHash string
}
Migration is the database representation of migration.
func GetMigrations ¶
func GetMigrations(fileLoader FileLoader, databaseDirectory string) ([]*Migration, error)
GetMigrations loads every migration listed in a database manifest, preserving the order in which they are declared.