<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateMilitaryOperationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('military_operations', function (Blueprint $table) {
            $table->id();
            $table->foreignId('personnel_id')->constrained('military_personnel')->onDelete('cascade');
            $table->string('operation_name');
            $table->text('description');
            $table->integer('duration_months');
            $table->enum('status', ['Completed', 'In Progress', 'Planned']);
            $table->enum('result', ['SUCCESS', 'ACTIVE', 'PENDING'])->nullable();
            $table->string('color')->default('military-green'); // Border color
            $table->date('start_date')->nullable();
            $table->date('end_date')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('military_operations');
    }
}
