50
51
// RunDryrunTest tests a dryrun schema setup & update
52
>
func (tb *UpdateSchemaTestBase) RunDryrunTest(app *cli.App, db DB, dbNameFlag string, dir string, endVersion string) {
updatetest.go
53
>
command := append(tb.getCommandBase(), []string{
54
>
dbNameFlag, tb.DBName,
55
>
"-q",
56
>
"setup-schema",
57
>
"-v", "0.0",
58
>
}...)
59
>
tb.NoError(app.Run(command))
60
>
61
>
command = append(tb.getCommandBase(), []string{
62
>
dbNameFlag, tb.DBName,
63
>
"-q",
64
>
"update-schema",
65
>
"-d", dir,
66
>
}...)
67
>
tb.NoError(app.Run(command))
68
>
ver, err := db.ReadSchemaVersion()
69
>
tb.NoError(err)
70
>
// update the version to the latest
71
>
tb.Logger.Info(ver)
72
>
tb.Equal(endVersion, ver)
73
>
tb.NoError(db.DropAllTables())
74
>
}
75
76
// RunUpdateSchemaTest tests schema update