package logmessage import "time" type LogMessage struct { Id int64 `gorm:"primaryKey;AUTO_INCREMENT"` Platform string `gorm:"type:varchar(32);not null"` AppVersion string `gorm:"type:varchar(32);default:null"` OsName string `gorm:"type:varchar(32);default:null"` OsVersion string `gorm:"type:varchar(32);default:null"` DeviceId string `gorm:"type:varchar(64);default:null"` UserId *int64 `gorm:"type:bigint;default:null"` SessionId string `gorm:"type:varchar(64);default:null"` Level uint8 `gorm:"type:tinyint(1);not null;default:3"` ErrorCode string `gorm:"type:varchar(64);default:null"` Message string `gorm:"type:text;not null"` Stack string `gorm:"type:mediumtext;default:null"` Context string `gorm:"type:json;default:null"` ClientIP string `gorm:"type:varchar(45);default:null"` UserAgent string `gorm:"type:varchar(255);default:null"` Locale string `gorm:"type:varchar(16);default:null"` Digest string `gorm:"type:varchar(64);uniqueIndex:uniq_digest;default:null"` OccurredAt *time.Time `gorm:"type:datetime;default:null"` CreatedAt time.Time `gorm:"<-:create;comment:Create Time"` } func (LogMessage) TableName() string { return "log_message" }