From 1e3c6b4a662d33c25dcdfe1123fa943ec3da183d Mon Sep 17 00:00:00 2001 From: naiba Date: Mon, 28 Oct 2024 14:42:36 +0800 Subject: [PATCH] fix: migration --- model/api_token.go | 8 -------- service/singleton/singleton.go | 8 ++++---- 2 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 model/api_token.go diff --git a/model/api_token.go b/model/api_token.go deleted file mode 100644 index 1a777c9..0000000 --- a/model/api_token.go +++ /dev/null @@ -1,8 +0,0 @@ -package model - -type ApiToken struct { - Common - UserID uint64 `json:"user_id"` - Token string `json:"token"` - Note string `json:"note"` -} diff --git a/service/singleton/singleton.go b/service/singleton/singleton.go index 19cd3e5..541ae48 100644 --- a/service/singleton/singleton.go +++ b/service/singleton/singleton.go @@ -61,10 +61,10 @@ func InitDBFromPath(path string) { if Conf.Debug { DB = DB.Debug() } - err = DB.AutoMigrate(model.Server{}, model.User{}, - model.Notification{}, model.AlertRule{}, model.Service{}, - model.ServiceHistory{}, model.Cron{}, model.Transfer{}, - model.ApiToken{}, model.NAT{}, model.DDNSProfile{}, model.NotificationGroupNotification{}) + err = DB.AutoMigrate(model.Server{}, model.User{}, model.ServerGroup{}, model.NotificationGroup{}, + model.Notification{}, model.AlertRule{}, model.Service{}, model.NotificationGroupNotification{}, + model.ServiceHistory{}, model.Cron{}, model.Transfer{}, model.ServerGroupServer{}, model.UserGroup{}, + model.UserGroupUser{}, model.NAT{}, model.DDNSProfile{}, model.NotificationGroupNotification{}) if err != nil { panic(err) }