Skip to content

Commit

Permalink
omit migration on first install #171
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Jun 28, 2024
1 parent 6672a27 commit 0d36b81
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion backend/cmd/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"log"
"os"
"s-ui/config"
"s-ui/database"
"s-ui/database/model"
Expand All @@ -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)
}
Expand Down

0 comments on commit 0d36b81

Please sign in to comment.