lots of updates + refactoring

This commit is contained in:
Andras Bacsai
2023-08-07 22:14:21 +02:00
parent bfc20ef219
commit 971d7f703d
51 changed files with 532 additions and 324 deletions

View File

@@ -11,7 +11,7 @@ return new class extends Migration
*/
public function up(): void
{
Schema::create('standalone_postgres', function (Blueprint $table) {
Schema::create('standalone_postgresqls', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->string('name');
@@ -24,9 +24,21 @@ return new class extends Migration
$table->string('postgres_host_auth_method')->nullable();
$table->json('init_scripts')->nullable();
$table->string('status')->default('exited');
$table->string('image')->default('postgres:15-alpine');
$table->boolean('is_public')->default(false);
$table->integer('public_port')->nullable();
$table->string('limits_memory')->default("0");
$table->string('limits_memory_swap')->default("0");
$table->integer('limits_memory_swappiness')->default(60);
$table->string('limits_memory_reservation')->default("0");
$table->string('limits_cpus')->default("0");
$table->string('limits_cpuset')->nullable()->default("0");
$table->integer('limits_cpu_shares')->default(1024);
$table->timestamp('started_at')->nullable();
$table->morphs('destination');
@@ -40,6 +52,6 @@ return new class extends Migration
*/
public function down(): void
{
Schema::dropIfExists('standalone_postgres');
Schema::dropIfExists('standalone_postgresqls');
}
};
};

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('environment_variables', function (Blueprint $table) {
$table->dropColumn('service_id');
$table->dropColumn('database_id');
$table->foreignId('standalone_postgresql_id')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('environment_variables', function (Blueprint $table) {
$table->foreignId('service_id')->nullable();
$table->foreignId('database_id')->nullable();
$table->dropColumn('standalone_postgresql_id');
});
}
};

View File

@@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('local_persistent_volumes', function (Blueprint $table) {
$table->boolean('is_readonly')->default(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('local_persistent_volumes', function (Blueprint $table) {
$table->dropColumn('is_readonly');
});
}
};