Skip to content

Commit

Permalink
Fix one more issue found in workflow delete cli
Browse files Browse the repository at this point in the history
  • Loading branch information
parauliya committed Nov 15, 2019
1 parent 07e33ad commit 621f218
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion db/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,30 @@ func DeleteWorkflow(ctx context.Context, db *sql.DB, id string, state int32) err
return errors.Wrap(err, "BEGIN transaction")
}

_, err = tx.Exec(`
DELETE FROM workflow_worker_map
WHERE
workflow_id = $1;
`, id)
if err != nil {
return errors.Wrap(err, "Delete Workflow Error")
}

_, err = tx.Exec(`
DELETE FROM workflow_state
WHERE
workflow_id = $1;
`, id)
if err != nil {
return errors.Wrap(err, "Delete Workflow Error")
}

_, err = tx.Exec(`
UPDATE workflow
SET
deleted_at = NOW()
WHERE
id = $1
id = $1;
`, id)
if err != nil {
return errors.Wrap(err, "UPDATE")
Expand Down

0 comments on commit 621f218

Please sign in to comment.