add ID column
This commit is contained in:
parent
7a8582fd0b
commit
35467af17d
|
@ -10,6 +10,7 @@ import (
|
|||
type DailyPlayerStats struct {
|
||||
tableName struct{} `pg:"?SERVER.daily_player_stats,alias:daily_player_stats"`
|
||||
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
PlayerID int `pg:",unique:group_1" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||
Player *Player `json:"player" gqlgen:"-" xml:"player" pg:"rel:has-one"`
|
||||
Villages int `json:"villages" pg:",use_zero" gqlgen:"villages" xml:"villages"`
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
type DailyTribeStats struct {
|
||||
tableName struct{} `pg:"?SERVER.daily_tribe_stats,alias:daily_tribe_stats"`
|
||||
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
TribeID int `pg:",unique:group_1" json:"tribeID" gqlgen:"tribeID" xml:"tribeID"`
|
||||
Tribe *Tribe `json:"tribe" gqlgen:"-" xml:"tribe" pg:"rel:has-one"`
|
||||
Members int `json:"members" gqlgen:"members" pg:",use_zero" xml:"members"`
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
type Ennoblement struct {
|
||||
tableName struct{} `pg:"?SERVER.ennoblements,alias:ennoblement"`
|
||||
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
VillageID int `pg:",use_zero" gqlgen:"-" json:"villageID" xml:"villageID"`
|
||||
Village *Village `gqlgen:"-" json:"village,omitempty" xml:"village" pg:"rel:has-one"`
|
||||
NewOwnerID int `pg:",use_zero" gqlgen:"-" json:"newOwnerID" xml:"newOwnerID"`
|
||||
|
|
|
@ -12,6 +12,7 @@ type PlayerHistory struct {
|
|||
|
||||
OpponentsDefeated
|
||||
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
PlayerID int `pg:",unique:group_1" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||
Player *Player `json:"player" gqlgen:"-" xml:"player" pg:"rel:has-one"`
|
||||
TotalVillages int `json:"totalVillages" pg:",use_zero" gqlgen:"totalVillages" xml:"totalVillages"`
|
||||
|
|
|
@ -3,6 +3,7 @@ package models
|
|||
import "time"
|
||||
|
||||
type PlayerNameChange struct {
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
VersionCode VersionCode `pg:",unique:group_1" json:"versionCode" gqlgen:"versionCode" xml:"versionCode"`
|
||||
Version *Version `pg:"fk:version_code,rel:has-one" json:"version" gqlgen:"version" xml:"version"`
|
||||
PlayerID int `pg:",unique:group_1" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package models
|
||||
|
||||
type PlayerToServer struct {
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
ServerKey string `pg:",unique:group_1" json:"serverKey" gqlgen:"serverKey" xml:"serverKey"`
|
||||
Server *Server `pg:"fk:server_key,rel:has-one" json:"server" gqlgen:"server" xml:"server"`
|
||||
PlayerID int `pg:",unique:group_1" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
type ServerStats struct {
|
||||
tableName struct{} `pg:"?SERVER.stats,alias:stats"`
|
||||
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
ActivePlayers int `pg:",use_zero" json:"activePlayers" gqlgen:"activePlayers" xml:"activePlayers"`
|
||||
InactivePlayers int `pg:",use_zero" json:"inactivePlayers" gqlgen:"inactivePlayers" xml:"inactivePlayers"`
|
||||
Players int `pg:",use_zero" json:"players" gqlgen:"players" xml:"players"`
|
||||
|
|
|
@ -3,6 +3,7 @@ package models
|
|||
type SpecialServer struct {
|
||||
tableName struct{} `pg:"special_servers,alias:special_server"`
|
||||
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
VersionCode VersionCode `pg:",unique:group_1" json:"versionCode" gqlgen:"versionCode" xml:"versionCode"`
|
||||
Version *Version `pg:"fk:version_code,rel:has-one" json:"omitempty,version" gqlgen:"-" xml:"version"`
|
||||
Key string `pg:",unique:group_1" json:"key" gqlgen:"key" xml:"key"`
|
||||
|
|
|
@ -10,6 +10,7 @@ import (
|
|||
type TribeChange struct {
|
||||
tableName struct{} `pg:"?SERVER.tribe_changes,alias:tribe_change"`
|
||||
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
PlayerID int `pg:",use_zero" json:"playerID" gqlgen:"playerID" xml:"playerID"`
|
||||
Player *Player `json:"player,omitempty" gqlgen:"-" xml:"player" pg:"rel:has-one"`
|
||||
OldTribeID int `pg:",use_zero" json:"oldTribeID" gqlgen:"oldTribeID" xml:"oldTribeID"`
|
||||
|
|
|
@ -12,6 +12,7 @@ type TribeHistory struct {
|
|||
|
||||
OpponentsDefeated
|
||||
|
||||
ID int `json:"id" gqlgen:"id" xml:"id"`
|
||||
TribeID int `pg:",unique:group_1" json:"-" pg:",use_zero" gqlgen:"tribeID" xml:"tribeID"`
|
||||
Tribe *Tribe `json:"tribe,omitempty" gqlgen:"-" xml:"tribe" pg:"rel:has-one"`
|
||||
TotalMembers int `json:"totalMembers" gqlgen:"totalMembers" pg:",use_zero"`
|
||||
|
|
Reference in New Issue