<?php

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

class CreateMilitaryTrainingTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('military_training', function (Blueprint $table) {
            $table->id();
            $table->foreignId('personnel_id')->constrained('military_personnel')->onDelete('cascade');
            $table->string('training_name');
            $table->enum('status', ['COMPLETED', 'CERTIFIED', 'QUALIFIED', 'FLUENT']);
            $table->string('icon')->default('fas fa-shield-alt'); // FontAwesome icon
            $table->string('color')->default('military-green'); // Color class
            $table->date('completion_date')->nullable();
            $table->timestamps();
        });
    }

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