Sync branch magefile with main #104308

Merged
Sybren A. Stüvel merged 85 commits from abelli/flamenco:magefile into magefile 2024-05-13 16:26:32 +02:00
4 changed files with 13 additions and 11 deletions
Showing only changes of commit 3fbb3cde34 - Show all commits

View File

@ -742,7 +742,7 @@ func convertSqlcJob(job sqlc.Job) (*Job, error) {
CreatedAt: job.CreatedAt,
UpdatedAt: job.UpdatedAt.Time,
},
UUID: job.Uuid,
UUID: job.UUID,
Name: job.Name,
JobType: job.JobType,
Priority: int(job.Priority),
@ -755,11 +755,11 @@ func convertSqlcJob(job sqlc.Job) (*Job, error) {
}
if err := json.Unmarshal(job.Settings, &dbJob.Settings); err != nil {
return nil, jobError(err, fmt.Sprintf("job %s has invalid settings: %v", job.Uuid, err))
return nil, jobError(err, fmt.Sprintf("job %s has invalid settings: %v", job.UUID, err))
}
if err := json.Unmarshal(job.Metadata, &dbJob.Metadata); err != nil {
return nil, jobError(err, fmt.Sprintf("job %s has invalid metadata: %v", job.Uuid, err))
return nil, jobError(err, fmt.Sprintf("job %s has invalid metadata: %v", job.UUID, err))
}
if job.WorkerTagID.Valid {

View File

@ -14,7 +14,7 @@ type Job struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
Uuid string
UUID string
Name string
JobType string
Priority int64
@ -58,7 +58,7 @@ type Task struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
Uuid string
UUID string
Name string
Type string
JobID int64
@ -85,7 +85,7 @@ type Worker struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
Uuid string
UUID string
Secret string
Name string
Address string
@ -104,7 +104,7 @@ type WorkerTag struct {
ID int64
CreatedAt time.Time
UpdatedAt sql.NullTime
Uuid string
UUID string
Name string
Description string
}

View File

@ -31,7 +31,7 @@ VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
type CreateJobParams struct {
CreatedAt time.Time
Uuid string
UUID string
Name string
JobType string
Priority int64
@ -46,7 +46,7 @@ type CreateJobParams struct {
func (q *Queries) CreateJob(ctx context.Context, arg CreateJobParams) error {
_, err := q.db.ExecContext(ctx, createJob,
arg.CreatedAt,
arg.Uuid,
arg.UUID,
arg.Name,
arg.JobType,
arg.Priority,
@ -80,7 +80,7 @@ func (q *Queries) FetchJob(ctx context.Context, uuid string) (Job, error) {
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.Uuid,
&i.UUID,
&i.Name,
&i.JobType,
&i.Priority,
@ -107,7 +107,7 @@ func (q *Queries) FetchTask(ctx context.Context, uuid string) (Task, error) {
&i.ID,
&i.CreatedAt,
&i.UpdatedAt,
&i.Uuid,
&i.UUID,
&i.Name,
&i.Type,
&i.JobID,

View File

@ -11,3 +11,5 @@ sql:
go_type:
import: "encoding/json"
type: "RawMessage"
rename:
uuid: "UUID"