<?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
    {
        Schema::create('compromiso2s', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id');
            $table->string('compromise_type')->default('compromiso2');
            
            // Preguntas (5 preguntas por sección, 5 secciones = 25 preguntas)
            $table->string('pregunta_1')->nullable();
            $table->string('pregunta_2')->nullable();
            $table->string('pregunta_3')->nullable();
            $table->string('pregunta_4')->nullable();
            $table->string('pregunta_5')->nullable();
            $table->string('pregunta_6')->nullable();
            $table->string('pregunta_7')->nullable();
            $table->string('pregunta_8')->nullable();
            $table->string('pregunta_9')->nullable();
            $table->string('pregunta_10')->nullable();
            $table->string('pregunta_11')->nullable();
            $table->string('pregunta_12')->nullable();
            $table->string('pregunta_13')->nullable();
            $table->string('pregunta_14')->nullable();
            $table->string('pregunta_15')->nullable();
            $table->string('pregunta_16')->nullable();
            $table->string('pregunta_17')->nullable();
            $table->string('pregunta_18')->nullable();
            $table->string('pregunta_19')->nullable();
            $table->string('pregunta_20')->nullable();
            $table->string('pregunta_21')->nullable();
            $table->string('pregunta_22')->nullable();
            $table->string('pregunta_23')->nullable();
            $table->string('pregunta_24')->nullable();
            $table->string('pregunta_25')->nullable();
            
            $table->boolean('completed')->default(false);
            $table->timestamps();
            
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
        });
    }

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