feat(backup): mark existing backups as legacy

This commit is contained in:
peaklabs-dev 2026-02-02 22:31:28 +01:00
parent 3b68914b73
commit 307ea4d8d8
No known key found for this signature in database
2 changed files with 23 additions and 0 deletions

View file

@ -14,6 +14,7 @@ class ScheduledDatabaseBackupExecution extends BaseModel
's3_uploaded' => 'boolean',
'local_storage_deleted' => 'boolean',
's3_storage_deleted' => 'boolean',
'legacy' => 'boolean',
];
}

View file

@ -0,0 +1,22 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('scheduled_database_backup_executions', function (Blueprint $table) {
$table->boolean('legacy')->default(false)->after('filename');
});
// Mark all existing backup executions as legacy
DB::table('scheduled_database_backup_executions')->update(['legacy' => true]);
// @todo: In a future update or v5 we no longer need "databases_to_backup", "dump_all" in "scheduled_database_backups" - keeping them for now if we need to rollback.
// @todo: In a future update or v5 we no longer need "database_name" from "scheduled_database_backup_executions" - keeping them for now if we need to rollback.
}
};