Projects: delete: delete all builds first
Deleting jobsets first would fail because buildmetrics has an FK to the jobset. However, the jobset / project relationship is not marked as CASCADE. Deleting all the builds automatically cascades to delete buildmetrics, so deleting the relevant builds first, then deleting the jobset solves it.
This commit is contained in:
@ -78,8 +78,8 @@ sub project_DELETE {
|
||||
requireProjectOwner($c, $c->stash->{project});
|
||||
|
||||
$c->model('DB')->schema->txn_do(sub {
|
||||
$c->stash->{project}->jobsets->delete;
|
||||
$c->stash->{project}->builds->delete;
|
||||
$c->stash->{project}->jobsets->delete;
|
||||
$c->stash->{project}->delete;
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user