mirror of https://github.com/pressly/goose.git
Remove verbose custom type
parent
f640a5cb1b
commit
0e09297902
|
@ -26,7 +26,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if *verbose {
|
if *verbose {
|
||||||
goose.SetVerbosity(goose.VerboseOn)
|
goose.SetVerbose(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
switch args[0] {
|
switch args[0] {
|
||||||
|
|
18
goose.go
18
goose.go
|
@ -8,28 +8,18 @@ import (
|
||||||
"sync"
|
"sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// VerboseMode is the goose verbosity
|
|
||||||
type VerboseMode bool
|
|
||||||
|
|
||||||
const (
|
|
||||||
// VerboseOn is the goose verbose mode
|
|
||||||
VerboseOn VerboseMode = true
|
|
||||||
// VerboseOff is the goose silent mode
|
|
||||||
VerboseOff VerboseMode = false
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
duplicateCheckOnce sync.Once
|
duplicateCheckOnce sync.Once
|
||||||
minVersion = int64(0)
|
minVersion = int64(0)
|
||||||
maxVersion = int64((1 << 63) - 1)
|
maxVersion = int64((1 << 63) - 1)
|
||||||
timestampFormat = "20060102150405"
|
timestampFormat = "20060102150405"
|
||||||
verbose = VerboseOff
|
verbose = false
|
||||||
reMatchSQLComments = regexp.MustCompile(`(--.*)`)
|
reMatchSQLComments = regexp.MustCompile(`(--.*)`)
|
||||||
)
|
)
|
||||||
|
|
||||||
// SetVerbosity defines the goose verbosity
|
// SetVerbose set the goose verbosity mode
|
||||||
func SetVerbosity(vl VerboseMode) {
|
func SetVerbose(v bool) {
|
||||||
verbose = vl
|
verbose = v
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run runs a goose command.
|
// Run runs a goose command.
|
||||||
|
|
|
@ -202,7 +202,7 @@ func runSQLMigration(db *sql.DB, scriptFile string, v int64, direction bool) err
|
||||||
}
|
}
|
||||||
|
|
||||||
func printInfo(s string, args ...interface{}) {
|
func printInfo(s string, args ...interface{}) {
|
||||||
if verbose == VerboseOn {
|
if verbose {
|
||||||
log.Printf(s, args...)
|
log.Printf(s, args...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue