Skip to content

Commit

Permalink
Deletes job_pipeline_specs related to jobs when deleting a job
Browse files Browse the repository at this point in the history
  • Loading branch information
vyzaldysanchez committed Mar 17, 2024
1 parent d9e7eb1 commit bf712a2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/services/job/orm.go
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,9 @@ func (o *orm) DeleteJob(id int32, qopts ...pg.QOpt) error {
deleted_gateway_specs AS (
DELETE FROM gateway_specs WHERE id IN (SELECT gateway_spec_id FROM deleted_jobs)
)
deleted_job_pipeline_specs AS (
DELETE FROM job_pipeline_specs WHERE job_id IN (SELECT pipeline_spec_id FROM deleted_jobs)
)
DELETE FROM pipeline_specs WHERE id IN (SELECT pipeline_spec_id FROM deleted_jobs)`
res, cancel, err := q.ExecQIter(query, id)
defer cancel()
Expand Down

0 comments on commit bf712a2

Please sign in to comment.