<?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('compromises', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained()->onDelete('cascade');
            $table->string('compromise_type')->default('compromiso1');
            
            // Preguntas 1-15
            $table->integer('pregunta_1')->nullable();
            $table->integer('pregunta_2')->nullable();
            $table->integer('pregunta_3')->nullable();
            $table->integer('pregunta_4')->nullable();
            $table->integer('pregunta_5')->nullable();
            $table->integer('pregunta_6')->nullable();
            $table->integer('pregunta_7')->nullable();
            $table->integer('pregunta_8')->nullable();
            $table->integer('pregunta_9')->nullable();
            $table->integer('pregunta_10')->nullable();
            $table->unsignedTinyInteger('pregunta_11')->nullable();
            $table->unsignedTinyInteger('pregunta_12')->nullable();
            $table->unsignedTinyInteger('pregunta_13')->nullable();
            $table->unsignedTinyInteger('pregunta_14')->nullable();
            $table->unsignedTinyInteger('pregunta_15')->nullable();
            
            $table->boolean('completed')->default(false);
            $table->timestamps();
        });
    }

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