Commit ac06e9a4 by CaIon

feat: Add CheckSetup function call in main to ensure proper initialization #942

parent 97be874c
......@@ -52,6 +52,9 @@ func main() {
if err != nil {
common.FatalLog("failed to initialize database: " + err.Error())
}
model.CheckSetup()
// Initialize SQL Database
err = model.InitLogDB()
if err != nil {
......
......@@ -56,7 +56,7 @@ func createRootAccountIfNeed() error {
return nil
}
func checkSetup() {
func CheckSetup() {
setup := GetSetup()
if setup == nil {
// No setup record exists, check if we have a root user
......@@ -244,7 +244,6 @@ func migrateDB() error {
}
err = DB.AutoMigrate(&Setup{})
common.SysLog("database migrated")
checkSetup()
//err = createRootAccountIfNeed()
return err
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment