coolify/database/migrations/2023_08_07_142950_create_standalone_postgresqls_table.php

59 lines
1.9 KiB
PHP
Raw Normal View History

<?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
{
/**
* Run the migrations.
*/
public function up(): void
{
2023-08-07 22:14:21 +02:00
Schema::create('standalone_postgresqls', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->string('name');
2023-08-07 18:46:40 +02:00
$table->string('description')->nullable();
2023-03-27 18:14:33 +02:00
2023-08-07 18:46:40 +02:00
$table->string('postgres_user')->default('postgres');
2023-08-09 16:47:24 +02:00
$table->text('postgres_password');
2023-08-07 18:46:40 +02:00
$table->string('postgres_db')->default('postgres');
$table->string('postgres_initdb_args')->nullable();
$table->string('postgres_host_auth_method')->nullable();
$table->json('init_scripts')->nullable();
2023-08-07 22:14:21 +02:00
$table->string('status')->default('exited');
$table->string('image')->default('postgres:15-alpine');
2023-08-07 19:29:47 +02:00
$table->boolean('is_public')->default(false);
$table->integer('public_port')->nullable();
2023-08-09 16:47:24 +02:00
$table->text('ports_mappings')->nullable();
2023-08-07 19:29:47 +02:00
2024-06-10 22:43:34 +02:00
$table->string('limits_memory')->default('0');
$table->string('limits_memory_swap')->default('0');
2023-08-07 22:14:21 +02:00
$table->integer('limits_memory_swappiness')->default(60);
2024-06-10 22:43:34 +02:00
$table->string('limits_memory_reservation')->default('0');
2023-08-07 22:14:21 +02:00
2024-06-10 22:43:34 +02:00
$table->string('limits_cpus')->default('0');
$table->string('limits_cpuset')->nullable()->default('0');
2023-08-07 22:14:21 +02:00
$table->integer('limits_cpu_shares')->default(1024);
2023-08-07 18:46:40 +02:00
$table->timestamp('started_at')->nullable();
2023-03-27 18:14:33 +02:00
$table->morphs('destination');
2023-08-11 16:13:53 +02:00
$table->foreignId('environment_id')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
2023-08-07 22:14:21 +02:00
Schema::dropIfExists('standalone_postgresqls');
}
2023-08-07 22:14:21 +02:00
};