From 9848b00bd099e1e926927881c6defac935d558db Mon Sep 17 00:00:00 2001 From: Aditya Thebe Date: Sun, 22 Sep 2024 20:35:08 +0545 Subject: [PATCH] feat: spec on playbook runs --- models/playbooks.go | 1 + schema/playbooks.hcl | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/models/playbooks.go b/models/playbooks.go index c8589441..4afc4e5d 100644 --- a/models/playbooks.go +++ b/models/playbooks.go @@ -115,6 +115,7 @@ type PlaybookRun struct { ID uuid.UUID `json:"id" gorm:"default:generate_ulid()"` PlaybookID uuid.UUID `json:"playbook_id"` Status PlaybookRunStatus `json:"status,omitempty"` + Spec types.JSON `json:"spec"` CreatedAt time.Time `json:"created_at,omitempty" time_format:"postgres_timestamp" gorm:"<-:false"` StartTime *time.Time `json:"start_time,omitempty" time_format:"postgres_timestamp"` ScheduledTime time.Time `json:"scheduled_time,omitempty" time_format:"postgres_timestamp" gorm:"default:NOW(), NOT NULL"` diff --git a/schema/playbooks.hcl b/schema/playbooks.hcl index 546d84a3..82bf95ab 100644 --- a/schema/playbooks.hcl +++ b/schema/playbooks.hcl @@ -135,6 +135,11 @@ table "playbook_runs" { null = false type = uuid } + column "spec" { + null = false + type = jsonb + default = "{}" # temporary default value to make the migration possible. we can remove this later. + } column "status" { null = false type = text