mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
feat(env_group): migrate site_category to env_group
This commit is contained in:
parent
de1860718e
commit
a379211e3c
66 changed files with 4837 additions and 4251 deletions
|
@ -1,6 +1,7 @@
|
|||
package model
|
||||
|
||||
type SiteCategory struct {
|
||||
// EnvGroup represents a group of environments that can be synced across nodes
|
||||
type EnvGroup struct {
|
||||
Model
|
||||
Name string `json:"name"`
|
||||
SyncNodeIds []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
|
|
@ -1,9 +1,10 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gen"
|
||||
"gorm.io/gorm"
|
||||
"time"
|
||||
)
|
||||
|
||||
var db *gorm.DB
|
||||
|
@ -31,7 +32,7 @@ func GenerateAllModel() []any {
|
|||
BanIP{},
|
||||
Config{},
|
||||
Passkey{},
|
||||
SiteCategory{},
|
||||
EnvGroup{},
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ package model
|
|||
|
||||
type Site struct {
|
||||
Model
|
||||
Path string `json:"path"`
|
||||
Advanced bool `json:"advanced"`
|
||||
SiteCategoryID uint64 `json:"site_category_id"`
|
||||
SiteCategory *SiteCategory `json:"site_category,omitempty"`
|
||||
SyncNodeIDs []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
|
||||
Path string `json:"path" gorm:"uniqueIndex"`
|
||||
Advanced bool `json:"advanced"`
|
||||
EnvGroupID uint64 `json:"env_group_id"`
|
||||
EnvGroup *EnvGroup `json:"env_group,omitempty"`
|
||||
SyncNodeIDs []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
|
||||
}
|
||||
|
|
|
@ -2,7 +2,9 @@ package model
|
|||
|
||||
type Stream struct {
|
||||
Model
|
||||
Path string `json:"path"`
|
||||
Advanced bool `json:"advanced"`
|
||||
SyncNodeIDs []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
|
||||
Path string `json:"path" gorm:"uniqueIndex"`
|
||||
Advanced bool `json:"advanced"`
|
||||
EnvGroupID uint64 `json:"env_group_id"`
|
||||
EnvGroup *EnvGroup `json:"env_group,omitempty"`
|
||||
SyncNodeIDs []uint64 `json:"sync_node_ids" gorm:"serializer:json"`
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ type AuthToken struct {
|
|||
}
|
||||
|
||||
func (u *User) TableName() string {
|
||||
return "auths"
|
||||
return "users"
|
||||
}
|
||||
|
||||
func (u *User) AfterFind(_ *gorm.DB) error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue