omit migration on first install #171

This commit is contained in:
Alireza Ahmadi
2024-06-28 15:58:15 +02:00
parent 6672a2721f
commit 0d36b811dc
+9 -1
View File
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"log"
"os"
"s-ui/config"
"s-ui/database"
"s-ui/database/model"
@@ -13,7 +14,14 @@ import (
)
func migrateDb() {
err := database.OpenDB(config.GetDBPath())
// void running on first install
path := config.GetDBPath()
_, err := os.Stat(path)
if err != nil {
return
}
err = database.OpenDB(path)
if err != nil {
log.Fatal(err)
}