feat: DB migration for Backup retention
- rename number_of_backups_locally to database_backup_retention_amount_locally - add backup retention days to local stored backups - add s3 retention fields
This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('scheduled_database_backups', function (Blueprint $table) {
|
||||||
|
$table->renameColumn('number_of_backups_locally', 'database_backup_retention_amount_locally');
|
||||||
|
$table->integer('database_backup_retention_amount_locally')->default(0)->nullable(false)->change();
|
||||||
|
$table->integer('database_backup_retention_days_locally')->default(0)->nullable(false);
|
||||||
|
|
||||||
|
$table->integer('database_backup_retention_amount_s3')->default(0)->nullable(false);
|
||||||
|
$table->integer('database_backup_retention_days_s3')->default(0)->nullable(false);
|
||||||
|
$table->integer('database_backup_retention_max_storage_s3')->default(0)->nullable(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('scheduled_database_backups', function (Blueprint $table) {
|
||||||
|
$table->renameColumn('database_backup_retention_amount_locally', 'number_of_backups_locally')->nullable(true)->change();
|
||||||
|
$table->dropColumn([
|
||||||
|
'database_backup_retention_days_locally',
|
||||||
|
'database_backup_retention_amount_s3',
|
||||||
|
'database_backup_retention_days_s3',
|
||||||
|
'database_backup_retention_max_storage_s3',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user