mirror of https://github.com/pressly/goose.git
Merge pull request #202 from KeiichiHirobe/fix-misleading-code
Fix misleading code/commentpull/210/head
commit
33602bcbcb
2
goose.go
2
goose.go
|
@ -4,13 +4,11 @@ import (
|
|||
"database/sql"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"sync"
|
||||
)
|
||||
|
||||
const VERSION = "v2.7.0-rc3"
|
||||
|
||||
var (
|
||||
duplicateCheckOnce sync.Once
|
||||
minVersion = int64(0)
|
||||
maxVersion = int64((1 << 63) - 1)
|
||||
timestampFormat = "20060102150405"
|
||||
|
|
|
@ -151,7 +151,7 @@ func CollectMigrations(dirpath string, current, target int64) (Migrations, error
|
|||
var migrations Migrations
|
||||
|
||||
// SQL migration files.
|
||||
sqlMigrationFiles, err := filepath.Glob(dirpath + "/**.sql")
|
||||
sqlMigrationFiles, err := filepath.Glob(dirpath + "/*.sql")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ func CollectMigrations(dirpath string, current, target int64) (Migrations, error
|
|||
}
|
||||
|
||||
// Go migration files
|
||||
goMigrationFiles, err := filepath.Glob(dirpath + "/**.go")
|
||||
goMigrationFiles, err := filepath.Glob(dirpath + "/*.go")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ type Migration struct {
|
|||
Version int64
|
||||
Next int64 // next version, or -1 if none
|
||||
Previous int64 // previous version, -1 if none
|
||||
Source string // path to .sql script
|
||||
Source string // path to .sql script or go file
|
||||
Registered bool
|
||||
UpFn func(*sql.Tx) error // Up go migration function
|
||||
DownFn func(*sql.Tx) error // Down go migration function
|
||||
|
|
Loading…
Reference in New Issue