<?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('seccion3_resultado_ejecucion', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->unsignedBigInteger('form_id');
            // TODO: Ajusta a tus campos reales
            $table->decimal('meta_programada', 18, 2)->nullable();
            $table->decimal('resultado_ejecutado', 18, 2)->nullable();
            $table->decimal('porcentaje_cumplimiento', 5, 2)->nullable();
            $table->text('observaciones')->nullable();
            $table->timestamps();

            $table->foreign('form_id')->references('id')->on('formularios')->onDelete('cascade');
            $table->unique('form_id');
        });
    }
    public function down(): void { Schema::dropIfExists('seccion3_resultado_ejecucion'); }
};
