<?php

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

class CreateEducationHistoryTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('education_history', function (Blueprint $table) {
            $table->id();
            $table->foreignId('personnel_id')->constrained('military_personnel')->onDelete('cascade');
            $table->string('degree_title');
            $table->string('institution');
            $table->date('graduation_date')->nullable();
            $table->decimal('gpa', 3, 2)->nullable();
            $table->text('special_recognition')->nullable(); // Honor Graduate, etc.
            $table->enum('status', ['Completed', 'In Progress', 'Planned']);
            $table->string('color')->default('blue-500'); // Border color
            $table->timestamps();
        });
    }

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