<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        if(!Schema::hasTable('after_action_reports')) {
            Schema::create('after_action_reports', function (Blueprint $table) {
                $table->id();
                $table->string('fc_id');
                $table->string('fc_name');
                $table->dateTime('formup_time');
                $table->string('formup_location');
                $table->text('doctrine');
                $table->text('objective');
                $table->enum('result', [
                    'Win',
                    'Lose',
                    'Neither',
                    'Unknown',
                ]);
                $table->text('summary');
                $table->text('improvements')->nullable();
                $table->text('worked_well')->nullable();
                $table->text('additional_comments')->nullable();
                $table->timestamps();
            });
        }
    }

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