``fix(pet): 修复宠物添加时捕捉时间冲突问题,添加唯一键约束和自增重试逻辑``
This commit is contained in:
@@ -11,8 +11,8 @@ const TableNamePet = "pet"
|
||||
type Pet struct {
|
||||
*cool.Model
|
||||
PlayerID uint32 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
|
||||
InBag int `gorm:"not null;comment:'是否在背包中'" json:"in_bag"` //"0为放入仓库,1为放入背包
|
||||
CatchTime uint32 `gorm:"not null;comment:'捕捉时间'" json:"catch_time"`
|
||||
InBag int `gorm:"not null;comment:'是否在背包中'" json:"in_bag"` //"0为放入仓库,1为放入背包
|
||||
CatchTime uint32 `gorm:"not null;unique;comment:'捕捉时间'" json:"catch_time"` //唯一键
|
||||
// Owner uint32 `struc:"skip"` //仅作为存储
|
||||
// FreedTime uint32 `struc:"skip"` //放生时间
|
||||
//是否可交易,这里应该定义在精灵ID里
|
||||
|
||||
Reference in New Issue
Block a user