2023-03-27 08:44:31 +00:00
|
|
|
<?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::create('applications', function (Blueprint $table) {
|
2023-05-25 11:23:42 +00:00
|
|
|
$table->id();
|
2023-05-11 13:20:02 +00:00
|
|
|
$table->integer('repository_project_id')->nullable();
|
2023-03-27 08:44:31 +00:00
|
|
|
$table->string('uuid')->unique();
|
|
|
|
$table->string('name');
|
2023-03-27 16:14:33 +00:00
|
|
|
|
2023-03-28 13:47:37 +00:00
|
|
|
$table->string('fqdn')->unique()->nullable();
|
|
|
|
$table->string('config_hash')->nullable();
|
|
|
|
|
|
|
|
$table->string('git_repository');
|
|
|
|
$table->string('git_branch');
|
2023-05-10 10:22:27 +00:00
|
|
|
$table->string('git_commit_sha')->default('HEAD');
|
2023-10-13 19:39:49 +00:00
|
|
|
// TODO: remove this column, it is not used
|
2023-05-10 11:05:32 +00:00
|
|
|
$table->string('git_full_url')->nullable();
|
2023-03-28 13:47:37 +00:00
|
|
|
|
|
|
|
$table->string('docker_registry_image_name')->nullable();
|
|
|
|
$table->string('docker_registry_image_tag')->nullable();
|
|
|
|
|
|
|
|
$table->string('build_pack');
|
2023-04-25 13:48:45 +00:00
|
|
|
$table->string('static_image')->default('nginx:alpine');
|
2023-03-28 13:47:37 +00:00
|
|
|
|
|
|
|
$table->string('install_command')->nullable();
|
|
|
|
$table->string('build_command')->nullable();
|
|
|
|
$table->string('start_command')->nullable();
|
|
|
|
|
|
|
|
$table->string('ports_exposes');
|
|
|
|
$table->string('ports_mappings')->nullable();
|
|
|
|
|
|
|
|
$table->string('base_directory')->default('/');
|
|
|
|
$table->string('publish_directory')->nullable();
|
|
|
|
|
2023-04-04 13:25:42 +00:00
|
|
|
$table->string('health_check_path')->default('/');
|
2023-03-28 13:47:37 +00:00
|
|
|
$table->string('health_check_port')->nullable();
|
|
|
|
$table->string('health_check_host')->default('localhost');
|
|
|
|
$table->string('health_check_method')->default('GET');
|
|
|
|
$table->integer('health_check_return_code')->default(200);
|
|
|
|
$table->string('health_check_scheme')->default('http');
|
|
|
|
$table->string('health_check_response_text')->nullable();
|
|
|
|
$table->integer('health_check_interval')->default(5);
|
|
|
|
$table->integer('health_check_timeout')->default(5);
|
|
|
|
$table->integer('health_check_retries')->default(10);
|
|
|
|
$table->integer('health_check_start_period')->default(5);
|
|
|
|
|
2024-06-10 20:43:34 +00:00
|
|
|
$table->string('limits_memory')->default('0');
|
|
|
|
$table->string('limits_memory_swap')->default('0');
|
2023-05-17 09:59:48 +00:00
|
|
|
$table->integer('limits_memory_swappiness')->default(60);
|
2024-06-10 20:43:34 +00:00
|
|
|
$table->string('limits_memory_reservation')->default('0');
|
2023-05-17 09:59:48 +00:00
|
|
|
|
2024-06-10 20:43:34 +00:00
|
|
|
$table->string('limits_cpus')->default('0');
|
|
|
|
$table->string('limits_cpuset')->nullable()->default('0');
|
2023-05-17 09:59:48 +00:00
|
|
|
$table->integer('limits_cpu_shares')->default(1024);
|
|
|
|
|
2023-03-30 19:15:25 +00:00
|
|
|
$table->string('status')->default('exited');
|
2023-05-30 13:52:17 +00:00
|
|
|
$table->string('preview_url_template')->default('{{pr_id}}.{{domain}}');
|
2023-03-28 13:47:37 +00:00
|
|
|
|
2023-04-25 12:43:35 +00:00
|
|
|
$table->nullableMorphs('destination');
|
2023-05-10 11:05:32 +00:00
|
|
|
$table->nullableMorphs('source');
|
2023-03-28 13:47:37 +00:00
|
|
|
|
2023-05-10 11:05:32 +00:00
|
|
|
$table->foreignId('private_key_id')->nullable();
|
2023-03-27 16:14:33 +00:00
|
|
|
$table->foreignId('environment_id');
|
2023-03-27 08:44:31 +00:00
|
|
|
$table->timestamps();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*/
|
|
|
|
public function down(): void
|
|
|
|
{
|
|
|
|
Schema::dropIfExists('applications');
|
|
|
|
}
|
|
|
|
};
|