This commit is contained in:
Sense T
2024-04-11 11:41:33 +08:00
parent 7a5fcf1972
commit 58c66fc3a8
10 changed files with 68 additions and 36 deletions

View File

@@ -26,6 +26,8 @@ func migrateDatabase(c *cli.Context) error {
if err := database.Connect(c.String("mysql-dsn")); err != nil {
return err
}
if c.Bool("debug") {
database.Client = database.Client.Debug()
}
return controllers.Migrate()
}

View File

@@ -26,6 +26,8 @@ func setDNS(c *cli.Context) error {
if err := database.Connect(c.String("mysql-dsn")); err != nil {
return err
}
if c.Bool("debug") {
database.Client = database.Client.Debug()
}
return controllers.SetupDNS(c.StringSlice("servers")...)
}

View File

@@ -34,5 +34,8 @@ func setUser(c *cli.Context) error {
if err := database.Connect(c.String("mysql-dsn")); err != nil {
return err
}
if c.Bool("debug") {
database.Client = database.Client.Debug()
}
return controllers.SetupAdmin(c.String("username"), c.String("password"))
}