Files
keystone/database/migrations/2025_03_31_140110_create_operations_table.php

29 lines
869 B
PHP

<?php
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('operations', function (Blueprint $table) {
$table->id();
$table->foreignId('parent_id')->nullable()->constrained('operations')->nullOnDelete();
$table->string('hash')->unique();
$table->string('kind')->default('service_deploy');
$table->morphs('target'); // server, service, etc.
$table->string('status');
$table->dateTime('started_at')->nullable();
$table->dateTime('finished_at')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('operations');
}
};