mirror of https://github.com/pressly/goose.git
rename collectMigrations to CollectMigrations
parent
221ff41793
commit
1e8921d41c
4
down.go
4
down.go
|
@ -11,7 +11,7 @@ func Down(db *sql.DB, dir string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
migrations, err := collectMigrations(dir, minVersion, maxVersion)
|
migrations, err := CollectMigrations(dir, minVersion, maxVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ func Down(db *sql.DB, dir string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func DownTo(db *sql.DB, dir string, version int64) error {
|
func DownTo(db *sql.DB, dir string, version int64) error {
|
||||||
migrations, err := collectMigrations(dir, minVersion, maxVersion)
|
migrations, err := CollectMigrations(dir, minVersion, maxVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,9 +85,9 @@ func AddMigration(up func(*sql.Tx) error, down func(*sql.Tx) error) {
|
||||||
goMigrations = append(goMigrations, migration)
|
goMigrations = append(goMigrations, migration)
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect all the valid looking migration scripts in the
|
// CollectMigrations returns all the valid looking migration scripts in the
|
||||||
// migrations folder and go func registry, and key them by version
|
// migrations folder and go func registry, and key them by version.
|
||||||
func collectMigrations(dirpath string, current, target int64) (Migrations, error) {
|
func CollectMigrations(dirpath string, current, target int64) (Migrations, error) {
|
||||||
var migrations Migrations
|
var migrations Migrations
|
||||||
|
|
||||||
// extract the numeric component of each migration,
|
// extract the numeric component of each migration,
|
||||||
|
|
2
redo.go
2
redo.go
|
@ -10,7 +10,7 @@ func Redo(db *sql.DB, dir string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
migrations, err := collectMigrations(dir, minVersion, maxVersion)
|
migrations, err := CollectMigrations(dir, minVersion, maxVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
|
|
||||||
func Status(db *sql.DB, dir string) error {
|
func Status(db *sql.DB, dir string) error {
|
||||||
// collect all migrations
|
// collect all migrations
|
||||||
migrations, err := collectMigrations(dir, minVersion, maxVersion)
|
migrations, err := CollectMigrations(dir, minVersion, maxVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
4
up.go
4
up.go
|
@ -6,7 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func UpTo(db *sql.DB, dir string, version int64) error {
|
func UpTo(db *sql.DB, dir string, version int64) error {
|
||||||
migrations, err := collectMigrations(dir, minVersion, version)
|
migrations, err := CollectMigrations(dir, minVersion, version)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ func Up(db *sql.DB, dir string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpByOne(db *sql.DB, dir string) error {
|
func UpByOne(db *sql.DB, dir string) error {
|
||||||
migrations, err := collectMigrations(dir, minVersion, maxVersion)
|
migrations, err := CollectMigrations(dir, minVersion, maxVersion)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue