diff --git a/down.go b/down.go index 2c92937..4246813 100644 --- a/down.go +++ b/down.go @@ -11,7 +11,7 @@ func Down(db *sql.DB, dir string) error { return err } - migrations, err := collectMigrations(dir, minVersion, maxVersion) + migrations, err := CollectMigrations(dir, minVersion, maxVersion) if err != nil { return err } @@ -25,7 +25,7 @@ func Down(db *sql.DB, dir string) 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 { return err } diff --git a/migrate.go b/migrate.go index b425d07..505146d 100644 --- a/migrate.go +++ b/migrate.go @@ -89,9 +89,9 @@ func AddNamedMigration(filename string, up func(*sql.Tx) error, down func(*sql.T goMigrations = append(goMigrations, migration) } -// collect all the valid looking migration scripts in the -// migrations folder and go func registry, and key them by version -func collectMigrations(dirpath string, current, target int64) (Migrations, error) { +// CollectMigrations returns all the valid looking migration scripts in the +// migrations folder and go func registry, and key them by version. +func CollectMigrations(dirpath string, current, target int64) (Migrations, error) { var migrations Migrations // extract the numeric component of each migration, diff --git a/redo.go b/redo.go index b78b081..183c88f 100644 --- a/redo.go +++ b/redo.go @@ -10,7 +10,7 @@ func Redo(db *sql.DB, dir string) error { return err } - migrations, err := collectMigrations(dir, minVersion, maxVersion) + migrations, err := CollectMigrations(dir, minVersion, maxVersion) if err != nil { return err } diff --git a/status.go b/status.go index 6819712..e1fd05d 100644 --- a/status.go +++ b/status.go @@ -10,7 +10,7 @@ import ( func Status(db *sql.DB, dir string) error { // collect all migrations - migrations, err := collectMigrations(dir, minVersion, maxVersion) + migrations, err := CollectMigrations(dir, minVersion, maxVersion) if err != nil { return err } diff --git a/up.go b/up.go index d785686..8f9d2e7 100644 --- a/up.go +++ b/up.go @@ -6,7 +6,7 @@ import ( ) 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 { return err } @@ -39,7 +39,7 @@ func Up(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 { return err }