47 lines
1.8 KiB
PHP
47 lines
1.8 KiB
PHP
<?php
|
|
|
|
use App\Models\Organisation;
|
|
use App\Models\Server;
|
|
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::create('services', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignIdFor(Organisation::class)->nullable();
|
|
$table->foreignId('environment_id')->nullable();
|
|
$table->foreignIdFor(Server::class)->nullable();
|
|
$table->string('name');
|
|
$table->string('status');
|
|
$table->string('category'); // database / cache / webserver
|
|
$table->string('type'); // postgres / redis / caddy
|
|
$table->string('version')->nullable(); // legacy alias for version_track
|
|
$table->string('version_track'); // 18 / 8 / 2 / php-8.4
|
|
$table->string('driver_name');
|
|
$table->unsignedInteger('desired_replicas')->default(1);
|
|
$table->string('desired_revision')->nullable();
|
|
$table->string('deploy_policy')->default('manual');
|
|
$table->json('process_roles')->nullable();
|
|
$table->string('current_image_digest')->nullable();
|
|
$table->string('available_image_digest')->nullable();
|
|
$table->string('update_status')->nullable();
|
|
$table->decimal('default_cpu_limit', 8, 3)->nullable();
|
|
$table->unsignedInteger('default_memory_limit_mb')->nullable();
|
|
$table->json('config')->nullable();
|
|
$table->text('credentials')->nullable();
|
|
$table->string('container_name')->nullable();
|
|
$table->string('container_id')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('services');
|
|
}
|
|
};
|