feat: service database backups

This commit is contained in:
Andras Bacsai committed 2023-11-07 12:11:47 +01:00
1 parent 2976c72e09
commit 516e10ddf2
10 files changed
+173 -41

No files matched your search

+12
View File
@@ -20,6 +20,14 @@ class ServiceDatabase extends BaseModel
{
return 'service';
}
public function databaseType()
{
$image = str($this->image)->before(':');
if ($image->value() === 'postgres') {
$image = 'postgresql';
}
return "standalone-$image";
}
public function service()
{
return $this->belongsTo(Service::class);
@@ -36,4 +44,8 @@ class ServiceDatabase extends BaseModel
{
getFilesystemVolumesFromServer($this, $isInit);
}
public function scheduledBackups()
{
return $this->morphMany(ScheduledDatabaseBackup::class, 'database');
}
}