Store s3_storage_id on scheduled volume backup executions so retention and recovery use the S3 that received the upload. Extract DeleteScheduledVolumeBackup for UI and resource deletion, and isolate database backup retention failures so cleanup errors do not fail the job.
49 lines
1.2 KiB
PHP
49 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class ScheduledVolumeBackupExecution extends BaseModel
|
|
{
|
|
protected $fillable = [
|
|
'uuid',
|
|
'scheduled_volume_backup_id',
|
|
's3_storage_id',
|
|
'status',
|
|
'message',
|
|
'size',
|
|
'filename',
|
|
'stop_container_ids',
|
|
'stop_recovery_pending',
|
|
's3_cleanup_pending',
|
|
'finished_at',
|
|
'local_storage_deleted',
|
|
's3_storage_deleted',
|
|
's3_uploaded',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'size' => 'integer',
|
|
'finished_at' => 'datetime',
|
|
'stop_container_ids' => 'array',
|
|
'stop_recovery_pending' => 'boolean',
|
|
's3_cleanup_pending' => 'boolean',
|
|
'local_storage_deleted' => 'boolean',
|
|
's3_storage_deleted' => 'boolean',
|
|
's3_uploaded' => 'boolean',
|
|
];
|
|
}
|
|
|
|
public function scheduledVolumeBackup(): BelongsTo
|
|
{
|
|
return $this->belongsTo(ScheduledVolumeBackup::class);
|
|
}
|
|
|
|
public function s3(): BelongsTo
|
|
{
|
|
return $this->belongsTo(S3Storage::class, 's3_storage_id');
|
|
}
|
|
}
|