refactor: 移除模型中的 uniqueIndex 约束

This commit is contained in:
xinian
2026-04-27 00:54:18 +08:00
parent f97275cb54
commit ec1855dfac
13 changed files with 29 additions and 19 deletions

View File

@@ -13,7 +13,7 @@ const TableNamePlayerInfo = "player_info"
type Player struct {
*cool.Model
PlayerID uint64 `gorm:"not null;uniqueIndex:idx_player_info_player_id,where:deleted_at IS NULL;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
PlayerID uint64 `gorm:"not null;index:idx_pet_by_player_id;comment:'所属玩家ID'" json:"player_id"`
LastResetTime *gtime.Time `struc:"skip" json:"last_reset_time"` // 重置时间,比如电池和每日任务
WeekLastResetTime *gtime.Time `struc:"skip" json:"week_last_reset_time"`
Data PlayerInfo `gorm:"type:jsonb;not null;comment:'全部数据'" json:"data"`