Merge pull request #202 from KeiichiHirobe/fix-misleading-code

Fix misleading code/comment
pull/210/head
Vojtech Vitek 2020-04-11 17:22:17 +02:00 committed by GitHub
commit 33602bcbcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 5 deletions

View File

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

View File

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

View File

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