diff options
Diffstat (limited to 'internal/api/database')
-rw-r--r-- | internal/api/database/models.go | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/internal/api/database/models.go b/internal/api/database/models.go index cd0d12d..4acbca5 100644 --- a/internal/api/database/models.go +++ b/internal/api/database/models.go @@ -11,15 +11,16 @@ type User struct { } type Game struct { - ID int `json:"id"` - Player1ID int `json:"-"` - Player1 User `gorm:"foreignKey:Player1ID" json:"player1"` - Player2ID *int `json:"-"` - Player2 *User `gorm:"foreignKey:Player2ID;null" json:"player2"` - Name string `json:"name"` - IP1 string `json:"ip1"` - IP2 string `json:"ip2"` - Outcome string `json:"outcome"` - CreatedAt time.Time `json:"created_at"` - UpdatedAt time.Time `json:"updated_at"` + ID int `json:"id"` + Player1ID int `json:"-"` + Player1 User `gorm:"foreignKey:Player1ID" json:"player1"` + Player2ID *int `json:"-"` + Player2 *User `gorm:"foreignKey:Player2ID;null" json:"player2"` + Name string `json:"name"` + IP1 string `json:"ip1"` + IP2 string `json:"ip2"` + Outcome string `json:"outcome"` + LastPlayer int `json:"last_player"` // Last player entered in game + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` } |