package model type User struct { ID uint64 `gorm:"primary_key;auto_increment" json:"id"` TelegramID int64 `gorm:"not null" json:"telegram_id"` ChatID int64 `gorm:"not null" json:"chat_id"` Language string `json:"language"` Chats []Chat `gorm:"foreignKey:UserID" json:"chats"` } func (User) TableName() string { return "user" }