2018-04-30 18:42:17 +05:00
|
|
|
package goose
|
|
|
|
|
|
|
|
import (
|
|
|
|
"database/sql"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Version prints the current version of the database.
|
|
|
|
func Version(db *sql.DB, dir string) error {
|
|
|
|
current, err := GetDBVersion(db)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
2019-10-13 13:55:38 +05:00
|
|
|
log.Printf("goose: version %v\n", current)
|
2018-04-30 18:42:17 +05:00
|
|
|
return nil
|
|
|
|
}
|
2019-10-13 13:55:38 +05:00
|
|
|
|
|
|
|
var tableName = "goose_db_version"
|
|
|
|
|
|
|
|
// TableName returns goose db version table name
|
|
|
|
func TableName() string {
|
|
|
|
return tableName
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetTableName set goose db version table name
|
|
|
|
func SetTableName(n string) {
|
|
|
|
tableName = n
|
|
|
|
}
|