coolify/database/migrations/2023_08_08_150103_create_scheduled_database_backups_table.php

31 lines
941 B
PHP
Raw Normal View History

2023-08-08 17:28:36 +02:00
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2023-08-11 20:48:52 +02:00
return new class extends Migration
{
2023-08-08 17:28:36 +02:00
public function up(): void
{
Schema::create('scheduled_database_backups', function (Blueprint $table) {
$table->id();
2023-08-11 16:13:53 +02:00
$table->text('description')->nullable();
2023-08-09 16:47:24 +02:00
$table->string('uuid')->unique();
2023-08-08 17:28:36 +02:00
$table->boolean('enabled')->default(true);
2023-08-11 16:13:53 +02:00
$table->boolean('save_s3')->default(true);
2023-08-08 17:28:36 +02:00
$table->string('frequency');
$table->integer('number_of_backups_locally')->default(7);
2023-08-08 17:28:36 +02:00
$table->morphs('database');
2023-08-11 16:13:53 +02:00
$table->foreignId('s3_storage_id')->nullable();
2023-08-08 17:28:36 +02:00
$table->foreignId('team_id');
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('scheduled_database_backups');
}
};