Files
keystone/database/migrations/2025_03_27_121049_create_environments_table.php

33 lines
1014 B
PHP

<?php
use App\Models\Application;
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('environments', function (Blueprint $table) {
$table->id();
$table->foreignIdFor(Application::class)->constrained()->cascadeOnDelete();
$table->string('name');
$table->string('branch');
$table->string('status')->default('pending');
$table->boolean('scheduler_enabled')->default(true);
$table->foreignId('scheduler_target_service_id')->nullable();
$table->string('scheduler_mode')->default('single');
$table->json('build_config')->nullable();
$table->timestamps();
$table->unique(['application_id', 'name']);
});
}
public function down(): void
{
Schema::dropIfExists('environments');
}
};