rename CreatedAt -> CreateDate in DailyPlayerStats, DailyTribeStats, PlayerHistory, PlayerNameChange, ServerStats, TribeHistory models
This commit is contained in:
parent
74c5a9b3b4
commit
0cd6cb6f1e
|
@ -5,12 +5,12 @@ import "time"
|
||||||
type DailyPlayerStats struct {
|
type DailyPlayerStats struct {
|
||||||
tableName struct{} `pg:"?SERVER.daily_player_stats,alias:daily_player_stats"`
|
tableName struct{} `pg:"?SERVER.daily_player_stats,alias:daily_player_stats"`
|
||||||
|
|
||||||
PlayerID int `pg:",unique:group_1" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
PlayerID int `pg:",unique:group_1" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||||
Player *Player `json:"player" gqlgen:"-" xml:"player"`
|
Player *Player `json:"player" gqlgen:"-" xml:"player"`
|
||||||
Villages int `json:"villages" pg:",use_zero" gqlgen:"villages" xml:"villages"`
|
Villages int `json:"villages" pg:",use_zero" gqlgen:"villages" xml:"villages"`
|
||||||
Points int `json:"points" pg:",use_zero" gqlgen:"points" xml:"points"`
|
Points int `json:"points" pg:",use_zero" gqlgen:"points" xml:"points"`
|
||||||
Rank int `json:"rank" pg:",use_zero" gqlgen:"rank" xml:"rank"`
|
Rank int `json:"rank" pg:",use_zero" gqlgen:"rank" xml:"rank"`
|
||||||
CreatedAt time.Time `pg:"default:CURRENT_DATE,type:DATE,use_zero,unique:group_1" json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `pg:"default:CURRENT_DATE,type:DATE,use_zero,unique:group_1" json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
|
|
||||||
OpponentsDefeated
|
OpponentsDefeated
|
||||||
}
|
}
|
||||||
|
@ -21,11 +21,11 @@ type DailyPlayerStatsFilter struct {
|
||||||
PlayerID []int `json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
PlayerID []int `json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||||
PlayerIdNEQ []int `json:"playerIDNEQ" gqlgen:"playerIDNEQ" xml:"playerIDNEQ"`
|
PlayerIdNEQ []int `json:"playerIDNEQ" gqlgen:"playerIDNEQ" xml:"playerIDNEQ"`
|
||||||
|
|
||||||
CreatedAt time.Time `json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
CreatedAtGT time.Time `json:"createdAtGT" gqlgen:"createdAtGT" xml:"createdAtGT"`
|
CreateDateGT time.Time `json:"createDateGT" gqlgen:"createDateGT" xml:"createDateGT"`
|
||||||
CreatedAtGTE time.Time `json:"createdAtGTE" gqlgen:"createdAtGTE" xml:"createdAtGTE"`
|
CreateDateGTE time.Time `json:"createDateGTE" gqlgen:"createDateGTE" xml:"createDateGTE"`
|
||||||
CreatedAtLT time.Time `json:"createdAtLT" gqlgen:"createdAtLT" xml:"createdAtLT"`
|
CreateDateLT time.Time `json:"createDateLT" gqlgen:"createDateLT" xml:"createDateLT"`
|
||||||
CreatedAtLTE time.Time `json:"createdAtLTE" gqlgen:"createdAtLTE" xml:"createdAtLTE"`
|
CreateDateLTE time.Time `json:"createDateLTE" gqlgen:"createDateLTE" xml:"createDateLTE"`
|
||||||
|
|
||||||
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset" xml:"offset"`
|
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset" xml:"offset"`
|
||||||
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit" xml:"limit"`
|
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit" xml:"limit"`
|
||||||
|
|
|
@ -7,15 +7,15 @@ import (
|
||||||
type DailyTribeStats struct {
|
type DailyTribeStats struct {
|
||||||
tableName struct{} `pg:"?SERVER.daily_tribe_stats,alias:daily_tribe_stats"`
|
tableName struct{} `pg:"?SERVER.daily_tribe_stats,alias:daily_tribe_stats"`
|
||||||
|
|
||||||
TribeID int `pg:",unique:group_1" json:"tribeID" gqlgen:"tribeID" xml:"tribeID"`
|
TribeID int `pg:",unique:group_1" json:"tribeID" gqlgen:"tribeID" xml:"tribeID"`
|
||||||
Tribe *Tribe `json:"tribe" gqlgen:"-" xml:"tribe"`
|
Tribe *Tribe `json:"tribe" gqlgen:"-" xml:"tribe"`
|
||||||
Members int `json:"members" gqlgen:"members" pg:",use_zero" xml:"members"`
|
Members int `json:"members" gqlgen:"members" pg:",use_zero" xml:"members"`
|
||||||
Villages int `json:"villages" gqlgen:"villages" pg:",use_zero" xml:"villages"`
|
Villages int `json:"villages" gqlgen:"villages" pg:",use_zero" xml:"villages"`
|
||||||
Points int `json:"points" gqlgen:"points" pg:",use_zero" xml:"points"`
|
Points int `json:"points" gqlgen:"points" pg:",use_zero" xml:"points"`
|
||||||
AllPoints int `json:"allPoints" gqlgen:"allPoints" pg:",use_zero" xml:"allPoints"`
|
AllPoints int `json:"allPoints" gqlgen:"allPoints" pg:",use_zero" xml:"allPoints"`
|
||||||
Rank int `json:"rank" gqlgen:"rank" pg:",use_zero" xml:"rank"`
|
Rank int `json:"rank" gqlgen:"rank" pg:",use_zero" xml:"rank"`
|
||||||
Dominance float64 `json:"dominance" gqlgen:"dominance" pg:",use_zero" xml:"dominance"`
|
Dominance float64 `json:"dominance" gqlgen:"dominance" pg:",use_zero" xml:"dominance"`
|
||||||
CreatedAt time.Time `pg:"default:CURRENT_DATE,type:DATE,use_zero,unique:group_1" json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `pg:"default:CURRENT_DATE,type:DATE,use_zero,unique:group_1" json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
|
|
||||||
OpponentsDefeated
|
OpponentsDefeated
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,11 @@ type DailyTribeStatsFilter struct {
|
||||||
TribeID []int `json:"tribeID" gqlgen:"tribeID" xml:"tribeID"`
|
TribeID []int `json:"tribeID" gqlgen:"tribeID" xml:"tribeID"`
|
||||||
TribeIdNEQ []int `json:"tribeIDNEQ" gqlgen:"tribeIDNEQ" xml:"tribeIDNEQ"`
|
TribeIdNEQ []int `json:"tribeIDNEQ" gqlgen:"tribeIDNEQ" xml:"tribeIDNEQ"`
|
||||||
|
|
||||||
CreatedAt time.Time `json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
CreatedAtGT time.Time `json:"createdAtGT" gqlgen:"createdAtGT" xml:"createdAtGT"`
|
CreateDateGT time.Time `json:"createDateGT" gqlgen:"createDateGT" xml:"createDateGT"`
|
||||||
CreatedAtGTE time.Time `json:"createdAtGTE" gqlgen:"createdAtGTE" xml:"createdAtGTE"`
|
CreateDateGTE time.Time `json:"createDateGTE" gqlgen:"createDateGTE" xml:"createDateGTE"`
|
||||||
CreatedAtLT time.Time `json:"createdAtLT" gqlgen:"createdAtLT" xml:"createdAtLT"`
|
CreateDateLT time.Time `json:"createDateLT" gqlgen:"createDateLT" xml:"createDateLT"`
|
||||||
CreatedAtLTE time.Time `json:"createdAtLTE" gqlgen:"createdAtLTE" xml:"createdAtLTE"`
|
CreateDateLTE time.Time `json:"createDateLTE" gqlgen:"createDateLTE" xml:"createDateLTE"`
|
||||||
|
|
||||||
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset" xml:"offset"`
|
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset" xml:"offset"`
|
||||||
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit" xml:"limit"`
|
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit" xml:"limit"`
|
||||||
|
|
|
@ -14,7 +14,7 @@ type PlayerHistory struct {
|
||||||
Rank int `json:"rank" pg:",use_zero" gqlgen:"rank" xml:"rank"`
|
Rank int `json:"rank" pg:",use_zero" gqlgen:"rank" xml:"rank"`
|
||||||
TribeID int `json:"-" pg:",use_zero" gqlgen:"tribeID" xml:"tribeID"`
|
TribeID int `json:"-" pg:",use_zero" gqlgen:"tribeID" xml:"tribeID"`
|
||||||
Tribe *Tribe `json:"tribe,omitempty" gqlgen:"-" xml:"tribe"`
|
Tribe *Tribe `json:"tribe,omitempty" gqlgen:"-" xml:"tribe"`
|
||||||
CreatedAt time.Time `pg:"default:now(),type:DATE,unique:group_1,use_zero" json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `pg:"default:now(),type:DATE,unique:group_1,use_zero" json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type PlayerHistoryFilter struct {
|
type PlayerHistoryFilter struct {
|
||||||
|
@ -23,11 +23,11 @@ type PlayerHistoryFilter struct {
|
||||||
PlayerID []int `json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
PlayerID []int `json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||||
PlayerIdNEQ []int `json:"playerIDNEQ" gqlgen:"playerIDNEQ" xml:"playerIDNEQ"`
|
PlayerIdNEQ []int `json:"playerIDNEQ" gqlgen:"playerIDNEQ" xml:"playerIDNEQ"`
|
||||||
|
|
||||||
CreatedAt time.Time `json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
CreatedAtGT time.Time `json:"createdAtGT" gqlgen:"createdAtGT" xml:"createdAtGT"`
|
CreateDateGT time.Time `json:"createDateGT" gqlgen:"createDateGT" xml:"createDateGT"`
|
||||||
CreatedAtGTE time.Time `json:"createdAtGTE" gqlgen:"createdAtGTE" xml:"createdAtGTE"`
|
CreateDateGTE time.Time `json:"createDateGTE" gqlgen:"createDateGTE" xml:"createDateGTE"`
|
||||||
CreatedAtLT time.Time `json:"createdAtLT" gqlgen:"createdAtLT" xml:"createdAtLT"`
|
CreateDateLT time.Time `json:"createDateLT" gqlgen:"createDateLT" xml:"createDateLT"`
|
||||||
CreatedAtLTE time.Time `json:"createdAtLTE" gqlgen:"createdAtLTE" xml:"createdAtLTE"`
|
CreateDateLTE time.Time `json:"createDateLTE" gqlgen:"createDateLTE" xml:"createDateLTE"`
|
||||||
|
|
||||||
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset" xml:"offset"`
|
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset" xml:"offset"`
|
||||||
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit" xml:"limit"`
|
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit" xml:"limit"`
|
||||||
|
|
|
@ -8,5 +8,5 @@ type PlayerNameChange struct {
|
||||||
PlayerID int `pg:",unique:group_1" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
PlayerID int `pg:",unique:group_1" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||||
OldName string `pg:",unique:group_1" json:"oldName" gqlgen:"oldName" xml:"oldName"`
|
OldName string `pg:",unique:group_1" json:"oldName" gqlgen:"oldName" xml:"oldName"`
|
||||||
NewName string `pg:",unique:group_1" json:"newName" gqlgen:"newName" xml:"newName"`
|
NewName string `pg:",unique:group_1" json:"newName" gqlgen:"newName" xml:"newName"`
|
||||||
ChangedOn time.Time `pg:"default:CURRENT_DATE,type:DATE,use_zero,unique:group_1" json:"changedOn" gqlgen:"changedOn" xml:"changedOn"`
|
ChangeDate time.Time `pg:"default:CURRENT_DATE,type:DATE,use_zero,unique:group_1" json:"changeDate" gqlgen:"changeDate" xml:"changeDate"`
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,12 +18,12 @@ type ServerStats struct {
|
||||||
BonusVillages int `pg:",use_zero" json:"bonusVillages" gqlgen:"bonusVillages" xml:"bonusVillages"`
|
BonusVillages int `pg:",use_zero" json:"bonusVillages" gqlgen:"bonusVillages" xml:"bonusVillages"`
|
||||||
BarbarianVillages int `pg:",use_zero" json:"barbarianVillages" gqlgen:"barbarianVillages" xml:"barbarianVillages"`
|
BarbarianVillages int `pg:",use_zero" json:"barbarianVillages" gqlgen:"barbarianVillages" xml:"barbarianVillages"`
|
||||||
PlayerVillages int `pg:",use_zero" json:"playerVillages" gqlgen:"playerVillages" xml:"playerVillages"`
|
PlayerVillages int `pg:",use_zero" json:"playerVillages" gqlgen:"playerVillages" xml:"playerVillages"`
|
||||||
CreatedAt time.Time `pg:"default:now(),type:DATE,unique:group_1,use_zero" json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `pg:"default:now(),type:DATE,unique:group_1,use_zero" json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ServerStats) BeforeInsert(ctx context.Context) (context.Context, error) {
|
func (s *ServerStats) BeforeInsert(ctx context.Context) (context.Context, error) {
|
||||||
if s.CreatedAt.IsZero() {
|
if s.CreateDate.IsZero() {
|
||||||
s.CreatedAt = time.Now()
|
s.CreateDate = time.Now()
|
||||||
}
|
}
|
||||||
|
|
||||||
return ctx, nil
|
return ctx, nil
|
||||||
|
@ -32,11 +32,11 @@ func (s *ServerStats) BeforeInsert(ctx context.Context) (context.Context, error)
|
||||||
type ServerStatsFilter struct {
|
type ServerStatsFilter struct {
|
||||||
tableName struct{} `urlstruct:"stats"`
|
tableName struct{} `urlstruct:"stats"`
|
||||||
|
|
||||||
CreatedAt time.Time `json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
CreatedAtGT time.Time `json:"createdAtGT" gqlgen:"createdAtGT" xml:"createdAtGT"`
|
CreateDateGT time.Time `json:"createDateGT" gqlgen:"createDateGT" xml:"createDateGT"`
|
||||||
CreatedAtGTE time.Time `json:"createdAtGTE" gqlgen:"createdAtGTE" xml:"createdAtGTE"`
|
CreateDateGTE time.Time `json:"createDateGTE" gqlgen:"createDateGTE" xml:"createDateGTE"`
|
||||||
CreatedAtLT time.Time `json:"createdAtLT" gqlgen:"createdAtLT" xml:"createdAtLT"`
|
CreateDateLT time.Time `json:"createDateLT" gqlgen:"createDateLT" xml:"createDateLT"`
|
||||||
CreatedAtLTE time.Time `json:"createdAtLTE" gqlgen:"createdAtLTE" xml:"createdAtLTE"`
|
CreateDateLTE time.Time `json:"createDateLTE" gqlgen:"createDateLTE" xml:"createDateLTE"`
|
||||||
|
|
||||||
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset"`
|
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset"`
|
||||||
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit"`
|
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit"`
|
||||||
|
|
|
@ -15,7 +15,7 @@ type TribeHistory struct {
|
||||||
AllPoints int `json:"allPoints" gqlgen:"allPoints" pg:",use_zero"`
|
AllPoints int `json:"allPoints" gqlgen:"allPoints" pg:",use_zero"`
|
||||||
Rank int `json:"rank" gqlgen:"rank" pg:",use_zero"`
|
Rank int `json:"rank" gqlgen:"rank" pg:",use_zero"`
|
||||||
Dominance float64 `json:"dominance" gqlgen:"dominance" pg:",use_zero"`
|
Dominance float64 `json:"dominance" gqlgen:"dominance" pg:",use_zero"`
|
||||||
CreatedAt time.Time `pg:"default:now(),type:DATE,unique:group_1,use_zero" json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `pg:"default:now(),type:DATE,unique:group_1,use_zero" json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type TribeHistoryFilter struct {
|
type TribeHistoryFilter struct {
|
||||||
|
@ -24,11 +24,11 @@ type TribeHistoryFilter struct {
|
||||||
TribeID []int `json:"tribeID" gqlgen:"tribeID" xml:"tribeID"`
|
TribeID []int `json:"tribeID" gqlgen:"tribeID" xml:"tribeID"`
|
||||||
TribeIdNEQ []int `json:"tribeIDNEQ" gqlgen:"tribeIDNEQ" xml:"tribeIDNEQ"`
|
TribeIdNEQ []int `json:"tribeIDNEQ" gqlgen:"tribeIDNEQ" xml:"tribeIDNEQ"`
|
||||||
|
|
||||||
CreatedAt time.Time `json:"createdAt" gqlgen:"createdAt" xml:"createdAt"`
|
CreateDate time.Time `json:"createDate" gqlgen:"createDate" xml:"createDate"`
|
||||||
CreatedAtGT time.Time `json:"createdAtGT" gqlgen:"createdAtGT" xml:"createdAtGT"`
|
CreateDateGT time.Time `json:"createDateGT" gqlgen:"createDateGT" xml:"createDateGT"`
|
||||||
CreatedAtGTE time.Time `json:"createdAtGTE" gqlgen:"createdAtGTE" xml:"createdAtGTE"`
|
CreateDateGTE time.Time `json:"createDateGTE" gqlgen:"createDateGTE" xml:"createDateGTE"`
|
||||||
CreatedAtLT time.Time `json:"createdAtLT" gqlgen:"createdAtLT" xml:"createdAtLT"`
|
CreateDateLT time.Time `json:"createDateLT" gqlgen:"createDateLT" xml:"createDateLT"`
|
||||||
CreatedAtLTE time.Time `json:"createdAtLTE" gqlgen:"createdAtLTE" xml:"createdAtLTE"`
|
CreateDateLTE time.Time `json:"createDateLTE" gqlgen:"createDateLTE" xml:"createDateLTE"`
|
||||||
|
|
||||||
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset" xml:"offset"`
|
Offset int `urlstruct:",nowhere" json:"offset" gqlgen:"offset" xml:"offset"`
|
||||||
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit" xml:"limit"`
|
Limit int `urlstruct:",nowhere" json:"limit" gqlgen:"limit" xml:"limit"`
|
||||||
|
|
Reference in New Issue
Block a user