add MigrateDB func for a single source of truth

This commit is contained in:
Hamidreza Ghavami
2023-05-06 00:22:39 +04:30
parent 0a5811adf8
commit 26f160fb89
3 changed files with 14 additions and 6 deletions

View File

@@ -2,7 +2,6 @@ package main
import (
"fmt"
"github.com/spf13/cobra"
"log"
"os"
"os/signal"
@@ -16,6 +15,8 @@ import (
"x-ui/web/global"
"x-ui/web/service"
"github.com/spf13/cobra"
"github.com/op/go-logging"
)
@@ -215,8 +216,7 @@ func migrateDb() {
log.Fatal(err)
}
fmt.Println("Start migrating database...")
inboundService.MigrationRequirements()
inboundService.RemoveOrphanedTraffics()
inboundService.MigrateDB()
fmt.Println("Migration done!")
}