Fix User database struct

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2025-12-25 01:38:25 +08:00
parent bd726f80ea
commit ca08c997c8
2 changed files with 7 additions and 8 deletions

View File

@@ -5,13 +5,13 @@ import "github.com/google/uuid"
type User struct {
Id uint `json:"id" gorm:"primarykey;autoincrement"`
UUID uuid.UUID `json:"uuid" gorm:"type:uuid;uniqueindex;not null"`
UserId uuid.UUID `json:"user_id" gorm:"size:8;uniqueindex;not null"`
UserId uuid.UUID `json:"user_id" gorm:"type:uuid;uniqueindex;not null"`
Email string `json:"email" gorm:"uniqueindex;not null"`
Nickname string `json:"nickname" gorm:"not null"`
Type string `json:"type" gorm:"not null"`
Subtitle string `json:"subtitle" gorm:"not null"`
Avatar string `json:"avatar" gorm:"not null"`
Checkin bool `json:"checkin" gorm:"not null"`
Nickname string `json:"nickname"`
Subtitle string `json:"subtitle"`
Avatar string `json:"avatar"`
Checkin bool `json:"checkin" gorm:"not null;default:false"`
}
func (self *User) GetByEmail(email string) error {