Improved database model migration and added indexing (#2655)

This commit is contained in:
Zahar Izmailov
2025-02-03 15:36:03 +03:00
committed by GitHub
parent 8a7cffd63f
commit b922d986d6
5 changed files with 28 additions and 13 deletions

View File

@@ -2,9 +2,9 @@ package xray
type ClientTraffic struct {
Id int `json:"id" form:"id" gorm:"primaryKey;autoIncrement"`
InboundId int `json:"inboundId" form:"inboundId"`
InboundId int `json:"inboundId" form:"inboundId" gorm:"index;not null"`
Enable bool `json:"enable" form:"enable"`
Email string `json:"email" form:"email" gorm:"unique"`
Email string `json:"email" form:"email" gorm:"uniqueIndex"`
Up int64 `json:"up" form:"up"`
Down int64 `json:"down" form:"down"`
ExpiryTime int64 `json:"expiryTime" form:"expiryTime"`