feat: able to delete configuration from server

This commit is contained in:
Andras Bacsai
2024-04-12 10:54:25 +02:00
parent 8b668cf8b7
commit 9032879e20
16 changed files with 127 additions and 10 deletions

View File

@@ -43,6 +43,18 @@ class StandaloneMysql extends BaseModel
$database->tags()->detach();
});
}
public function workdir()
{
return database_configuration_dir() . "/{$this->uuid}";
}
public function delete_configurations()
{
$server = data_get($this, 'destination.server');
$workdir = $this->workdir();
if (str($workdir)->endsWith($this->uuid)) {
instant_remote_process(["rm -rf " . $this->workdir()], $server, false);
}
}
public function realStatus()
{
return $this->getRawOriginal('status');