25 lines
444 B
Go
25 lines
444 B
Go
package models
|
|
|
|
import (
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Task struct {
|
|
ID uuid.UUID `gorm:"primarykey" json:"id"`
|
|
|
|
Title string
|
|
Text string
|
|
MaxTime int
|
|
Game *Game
|
|
GameID uuid.UUID
|
|
Codes []*Code `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
|
|
TaskOrder uint
|
|
}
|
|
|
|
type Code struct {
|
|
ID uuid.UUID `gorm:"primarykey" json:"id"`
|
|
|
|
TaskID uuid.UUID
|
|
Code string `gorm:"index"`
|
|
Description string
|
|
}
|