You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
524 B
30 lines
524 B
package main
|
|
|
|
import (
|
|
"bitbucket.org/liamstask/goose/lib/goose"
|
|
"fmt"
|
|
"log"
|
|
)
|
|
|
|
var dbVersionCmd = &Command{
|
|
Name: "dbversion",
|
|
Usage: "",
|
|
Summary: "Print the current version of the database",
|
|
Help: `dbversion extended help here...`,
|
|
Run: dbVersionRun,
|
|
}
|
|
|
|
func dbVersionRun(cmd *Command, args ...string) {
|
|
conf, err := dbConfFromFlags()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
current, err := goose.GetDBVersion(conf)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
fmt.Printf("goose: dbversion %v\n", current)
|
|
}
|