定义model
This commit is contained in:
@@ -82,7 +82,7 @@ const (
|
||||
|
||||
// GroupMedicationLog 记录了对整个猪批次的用药情况
|
||||
type GroupMedicationLog struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
gorm.Model
|
||||
PigBatchID uint `gorm:"not null;index;comment:关联的猪批次ID"`
|
||||
MedicationID uint `gorm:"not null;index;comment:关联的药品ID"`
|
||||
Medication Medication `gorm:"foreignKey:MedicationID"` // 预加载药品信息
|
||||
@@ -92,9 +92,6 @@ type GroupMedicationLog struct {
|
||||
Description string `gorm:"size:255;comment:具体描述,如'治疗呼吸道病'"`
|
||||
Operator string `gorm:"size:50;comment:操作员"`
|
||||
HappenedAt time.Time `gorm:"primaryKey;comment:用药时间"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
DeletedAt gorm.DeletedAt `gorm:"index"`
|
||||
}
|
||||
|
||||
func (GroupMedicationLog) TableName() string {
|
||||
|
||||
Reference in New Issue
Block a user