<?php

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

class CreateCertificationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('certifications', function (Blueprint $table) {
            $table->id();
            $table->foreignId('personnel_id')->constrained('military_personnel')->onDelete('cascade');
            $table->string('certification_name');
            $table->enum('status', ['ACTIVE', 'EXPIRED', 'PENDING']);
            $table->date('expiration_date')->nullable();
            $table->string('color')->default('green-500'); // Border color
            $table->timestamps();
        });
    }

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