feat(backup): implement custom database type selection and enhance scheduled backups management
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user