mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 15:02:34 +00:00
- 2.x - sites (wip)
- improved ssh error handling - database soft deletes
This commit is contained in:
@ -3,9 +3,11 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\DatabaseStatus;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
* @property int $server_id
|
||||
@ -13,10 +15,12 @@
|
||||
* @property string $status
|
||||
* @property Server $server
|
||||
* @property Backup[] $backups
|
||||
* @property Carbon $deleted_at
|
||||
*/
|
||||
class Database extends AbstractModel
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'server_id',
|
||||
@ -41,9 +45,6 @@ public static function boot(): void
|
||||
$user->save();
|
||||
}
|
||||
});
|
||||
$database->backups()->each(function (Backup $backup) {
|
||||
$backup->delete();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user