feat: service database backups
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user