feat(backup): implement custom database type selection and enhance scheduled backups management

This commit is contained in:
Andras Bacsai
2025-04-30 16:44:44 +02:00
parent debfcb7028
commit fe24296de7
9 changed files with 74 additions and 36 deletions

View File

@@ -16,6 +16,7 @@ class ServiceDatabase extends BaseModel
static::deleting(function ($service) {
$service->persistentStorages()->delete();
$service->fileStorages()->delete();
$service->scheduledBackups()->delete();
});
static::saving(function ($service) {
if ($service->isDirty('status')) {
@@ -77,6 +78,9 @@ class ServiceDatabase extends BaseModel
public function databaseType()
{
if (filled($this->custom_type)) {
return 'standalone-'.$this->custom_type;
}
$image = str($this->image)->before(':');
if ($image->contains('supabase/postgres')) {
$finalImage = 'supabase/postgres';
@@ -141,6 +145,7 @@ class ServiceDatabase extends BaseModel
str($this->databaseType())->contains('postgres') ||
str($this->databaseType())->contains('postgis') ||
str($this->databaseType())->contains('mariadb') ||
str($this->databaseType())->contains('mongo');
str($this->databaseType())->contains('mongo') ||
filled($this->custom_type);
}
}