package models import "time" type User struct { Base Username string `gorm:"type:citext;uniqueIndex;not null" json:"username"` Email string `gorm:"type:citext;uniqueIndex;not null" json:"email"` HashedPassword string `gorm:"not null" json:"-"` Avatar string `gorm:"type:text" json:"avatar"` IsVerified bool `gorm:"default:false" json:"is_verified"` LastActivity time.Time `gorm:"type:timestamp with time zone;index:idx_users_last_activity_at" json:"last_activity"` // Relationships PreferredGenres []Genre `gorm:"many2many:user_preferred_genres;" json:"preferred_genres,omitempty"` OwnedTracks []Track `gorm:"foreignKey:OwnerID" json:"owned_tracks,omitempty"` Comments []Comment `gorm:"foreignKey:AuthorID" json:"comments,omitempty"` IsFt bool `gorm:"default:false"` Friends []*User `gorm:"many2many:user_friends"` }