Refactor db migrations

This commit is contained in:
Andras Bacsai
2023-08-09 16:47:24 +02:00
parent a3353aac0c
commit 04622a9e3b
16 changed files with 57 additions and 49 deletions

View File

@@ -17,7 +17,7 @@ return new class extends Migration {
$table->string('description')->nullable();
$table->string('postgres_user')->default('postgres');
$table->string('postgres_password');
$table->text('postgres_password');
$table->string('postgres_db')->default('postgres');
$table->string('postgres_initdb_args')->nullable();
$table->string('postgres_host_auth_method')->nullable();
@@ -28,6 +28,7 @@ return new class extends Migration {
$table->string('image')->default('postgres:15-alpine');
$table->boolean('is_public')->default(false);
$table->integer('public_port')->nullable();
$table->text('ports_mappings')->nullable();
$table->string('limits_memory')->default("0");
$table->string('limits_memory_swap')->default("0");

View File

@@ -1,21 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
Schema::table('standalone_postgresqls', function (Blueprint $table) {
$table->text('ports_mappings')->nullable();
});
}
public function down(): void
{
Schema::table('standalone_postgresqls', function (Blueprint $table) {
$table->dropColumn('ports_mappings');
});
}
};

View File

@@ -9,6 +9,7 @@ return new class extends Migration {
{
Schema::create('scheduled_database_backups', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->boolean('enabled')->default(true);
$table->boolean('keep_locally')->default(true);
$table->string('save_s3')->default(true);

View File

@@ -1,21 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
Schema::table('standalone_postgresqls', function (Blueprint $table) {
$table->text('postgres_password')->change();
});
}
public function down(): void
{
Schema::table('standalone_postgresqls', function (Blueprint $table) {
$table->string('postgres_password')->change();
});
}
};