| Index: datahopper/go/buildbot_migratedb/main.go
|
| diff --git a/golden/go/correctness_migratedb/main.go b/datahopper/go/buildbot_migratedb/main.go
|
| similarity index 65%
|
| copy from golden/go/correctness_migratedb/main.go
|
| copy to datahopper/go/buildbot_migratedb/main.go
|
| index 45ab64e4d240b48028d27ecd67170e06625efa7d..6f8395d6122ed05a24e32ce69c3233e7c287f454 100644
|
| --- a/golden/go/correctness_migratedb/main.go
|
| +++ b/datahopper/go/buildbot_migratedb/main.go
|
| @@ -5,20 +5,17 @@ package main
|
| // it is not entered via the command line.
|
|
|
| import (
|
| - "bufio"
|
| "flag"
|
| "fmt"
|
| - "os"
|
| - "strings"
|
|
|
| "github.com/golang/glog"
|
| + "skia.googlesource.com/buildbot.git/go/buildbot"
|
| "skia.googlesource.com/buildbot.git/go/common"
|
| "skia.googlesource.com/buildbot.git/go/database"
|
| - "skia.googlesource.com/buildbot.git/golden/go/db"
|
| )
|
|
|
| func main() {
|
| - defaultConnStr := db.GetConnectionString("root", "", "", "")
|
| + defaultConnStr := fmt.Sprintf(database.DB_CONN_TMPL, database.USER_RW, "%s", buildbot.PROD_DB_HOST, buildbot.PROD_DATABASE)
|
|
|
| // flags
|
| dbConnString := flag.String("db_conn_string", defaultConnStr, "\n\tDatabase string to open connect to the MySQL database. "+
|
| @@ -28,24 +25,7 @@ func main() {
|
| // Global init to initialize glog and parse arguments.
|
| common.Init()
|
|
|
| - var connectionStr = *dbConnString
|
| -
|
| - // if it contains formatting information read the password from stdin.
|
| - if strings.Contains(connectionStr, "%s") {
|
| - glog.Infof("Using connection string: %s", connectionStr)
|
| - reader := bufio.NewReader(os.Stdin)
|
| - fmt.Print("Enter password for MySQL: ")
|
| - password, err := reader.ReadString('\n')
|
| - if err != nil {
|
| - glog.Fatalf("Unable to read password. Error: %s", err)
|
| - }
|
| - connectionStr = fmt.Sprintf(connectionStr, strings.TrimRight(password, "\n"))
|
| - }
|
| -
|
| - conf := &database.DatabaseConfig{
|
| - MySQLString: connectionStr,
|
| - MigrationSteps: db.MigrationSteps(),
|
| - }
|
| + conf, err := database.ResolveCustomMySQLString(*dbConnString, buildbot.MigrationSteps())
|
| vdb := database.NewVersionedDB(conf)
|
|
|
| // Get the current database version
|
|
|