Sybren A. Stüvel ddced5a823 Transition from ex-GORM structs to sqlc structs (4/5)
Replace old used-to-be-GORM datastructures (#104305) with sqlc-generated
structs. This also makes it possible to use more specific structs that
are more taylored to the specific queries, increasing efficiency.

This commit deals with the worker sleep schedule.

Functional changes are kept to a minimum, as the API still serves the
same data.

Because this work covers so much of Flamenco's code, it's been split up
into different commits. Each commit brings Flamenco to a state where it
compiles and unit tests pass. Only the result of the final commit has
actually been tested properly.

Ref: #104343
2024-12-04 14:00:19 +01:00

120 lines
2.4 KiB
Go

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.26.0
package sqlc
import (
"database/sql"
"encoding/json"
"time"
"projects.blender.org/studio/flamenco/pkg/api"
"projects.blender.org/studio/flamenco/pkg/time_of_day"
)
type Job struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
UUID string
Name string
JobType string
Priority int64
Status api.JobStatus
Activity string
Settings json.RawMessage
Metadata json.RawMessage
DeleteRequestedAt sql.NullTime
StorageShamanCheckoutID string
WorkerTagID sql.NullInt64
}
type JobBlock struct {
ID int64
CreatedAt time.Time
JobID int64
WorkerID int64
TaskType string
}
type LastRendered struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
JobID int64
}
type SleepSchedule struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
WorkerID int64
IsActive bool
DaysOfWeek string
StartTime time_of_day.TimeOfDay
EndTime time_of_day.TimeOfDay
NextCheck sql.NullTime
}
type Task struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
UUID string
Name string
Type string
JobID int64
IndexInJob int64
Priority int64
Status api.TaskStatus
WorkerID sql.NullInt64
LastTouchedAt sql.NullTime
Commands json.RawMessage
Activity string
}
type TaskDependency struct {
TaskID int64
DependencyID int64
}
type TaskFailure struct {
CreatedAt time.Time
TaskID int64
WorkerID int64
}
type Worker struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
UUID string
Secret string
Name string
Address string
Platform string
Software string
Status api.WorkerStatus
LastSeenAt sql.NullTime
StatusRequested api.WorkerStatus
LazyStatusRequest bool
SupportedTaskTypes string
DeletedAt sql.NullTime
CanRestart bool
}
type WorkerTag struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
UUID string
Name string
Description string
}
type WorkerTagMembership struct {
WorkerTagID int64
WorkerID int64
}