refactor: Remove deployment queue when deleting an application
This commit is contained in:
parent
024ad8e943
commit
8ca8ab82b0
1 changed files with 8 additions and 0 deletions
|
|
@ -143,6 +143,9 @@ protected static function booted()
|
||||||
}
|
}
|
||||||
$application->tags()->detach();
|
$application->tags()->detach();
|
||||||
$application->previews()->delete();
|
$application->previews()->delete();
|
||||||
|
foreach ($application->deployment_queue as $deployment) {
|
||||||
|
$deployment->delete();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -710,6 +713,11 @@ public function previews()
|
||||||
return $this->hasMany(ApplicationPreview::class);
|
return $this->hasMany(ApplicationPreview::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function deployment_queue()
|
||||||
|
{
|
||||||
|
return $this->hasMany(ApplicationDeploymentQueue::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function destination()
|
public function destination()
|
||||||
{
|
{
|
||||||
return $this->morphTo();
|
return $this->morphTo();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue