refactor: Remove deployment queue when deleting an application
This commit is contained in:
@@ -143,6 +143,9 @@ class Application extends BaseModel
|
|||||||
}
|
}
|
||||||
$application->tags()->detach();
|
$application->tags()->detach();
|
||||||
$application->previews()->delete();
|
$application->previews()->delete();
|
||||||
|
foreach ($application->deployment_queue as $deployment) {
|
||||||
|
$deployment->delete();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -710,6 +713,11 @@ class Application extends BaseModel
|
|||||||
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();
|
||||||
|
Reference in New Issue
Block a user