<?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('trainings', function (Blueprint $table) {
            $table->id();
            $table->string('name');
            $table->text('summary');
            $table->date('creation_date');
            $table->date('start_date');
            $table->date('end_date');
            $table->integer('duration'); // calculated in days
            $table->string('location');
            $table->text('course_outline');
            $table->integer('expected_participants');
            $table->json('participants'); // array of officer IDs
            $table->string('trainer_name');
            $table->string('supervisor_name');
            $table->text('remarks')->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('trainings');
    }
};