File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -443,7 +443,26 @@ func DeleteRunByIDs(ctx context.Context, ids []int64) error {
443443 return err
444444 }
445445 defer committer .Close ()
446- _ , err = db .GetEngine (ctx ).In ("id" , ids ).Delete (ActionRun {})
446+
447+ _ , err = db .GetEngine (ctx ).
448+ Table ("action_task" ).
449+ Join ("INNER" , "action_task_step" , "action_task.id = action_task_step.task_id" ).
450+ In ("action_task.job_id" , ids ).
451+ Delete (ActionTaskStep {})
452+ if err != nil {
453+ return err
454+ }
455+
456+ _ , err = db .GetEngine (ctx ).
457+ Table ("action_task" ).
458+ Join ("INNER" , "action_task_output" , "action_task.id = action_task_output.task_id" ).
459+ In ("action_task.job_id" , ids ).
460+ Delete (ActionTaskOutput {})
461+ if err != nil {
462+ return err
463+ }
464+
465+ _ , err = db .GetEngine (ctx ).In ("job_id" , ids ).Delete (ActionTask {})
447466 if err != nil {
448467 return err
449468 }
@@ -453,6 +472,11 @@ func DeleteRunByIDs(ctx context.Context, ids []int64) error {
453472 return err
454473 }
455474
475+ _ , err = db .GetEngine (ctx ).In ("id" , ids ).Delete (ActionRun {})
476+ if err != nil {
477+ return err
478+ }
479+
456480 return committer .Commit ()
457481}
458482
You can’t perform that action at this time.
0 commit comments