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

@@ -469,8 +469,7 @@ func (s *ServerService) ImportDB(file multipart.File) error {
defer os.Rename(fallbackPath, config.GetDBPath())
return common.NewErrorf("Error migrating db: %v", err)
}
s.inboundService.MigrationRequirements()
s.inboundService.RemoveOrphanedTraffics()
s.inboundService.MigrateDB()
// remove fallback file
defer os.Remove(fallbackPath)