Merge pull request #22 from mmatczuk/mmt/export_collect_migrations

Rename collectMigrations to CollectMigrations
pull/26/head
Vojtech Vitek 2017-03-27 11:21:09 -04:00 committed by GitHub
commit 99e29546ba
5 changed files with 9 additions and 9 deletions

View File

@ -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
} }

View File

@ -89,9 +89,9 @@ func AddNamedMigration(filename string, up func(*sql.Tx) error, down func(*sql.T
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,

View File

@ -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
} }

View File

@ -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
View File

@ -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
} }