From d35c26ecc61103b4ba7d484acf76b6a969159518 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Mon, 7 Apr 2025 15:55:04 +0200 Subject: Start new play --- api/database/models.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'api/database/models.go') diff --git a/api/database/models.go b/api/database/models.go index e309a36..900c7b3 100644 --- a/api/database/models.go +++ b/api/database/models.go @@ -9,3 +9,16 @@ type User struct { CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } + +type Play 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"` + CreatedAt time.Time `json:"created_at"` + UpdatedAt time.Time `json:"updated_at"` +} -- cgit v1.2.3-18-g5258