nquest/pkg/models/task.go

31 lines
509 B
Go

package models
import "github.com/google/uuid"
type Task struct {
Model
Title string
Text string
MaxTime int
GameID uuid.UUID
Solutions []*Solution `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
Codes []*Code `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
TaskOrder uint
}
type Solution struct {
Model
TaskID uuid.UUID
After int
Text string
}
type Code struct {
Model
TaskID uuid.UUID
Code string `gorm:"index"`
Description string
}