<?php

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

class CreateSurveyResponsesTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('survey_responses', function (Blueprint $table) {
            $table->id();
            
            // Bloque 1: q1_1 hasta q1_15
            $table->tinyInteger('q1_1')->nullable();
            $table->tinyInteger('q1_2')->nullable();
            $table->tinyInteger('q1_3')->nullable();
            $table->tinyInteger('q1_4')->nullable();
            $table->tinyInteger('q1_5')->nullable();
            $table->tinyInteger('q1_6')->nullable();
            $table->tinyInteger('q1_7')->nullable();
            $table->tinyInteger('q1_8')->nullable();
            $table->tinyInteger('q1_9')->nullable();
            $table->tinyInteger('q1_10')->nullable();
            $table->tinyInteger('q1_11')->nullable();
            $table->tinyInteger('q1_12')->nullable();
            $table->tinyInteger('q1_13')->nullable();
            $table->tinyInteger('q1_14')->nullable();
            $table->tinyInteger('q1_15')->nullable();

            // Bloque 2: q2_1 hasta q2_16
            $table->tinyInteger('q2_1')->nullable();
            $table->tinyInteger('q2_2')->nullable();
            $table->tinyInteger('q2_3')->nullable();
            $table->tinyInteger('q2_4')->nullable();
            $table->tinyInteger('q2_5')->nullable();
            $table->tinyInteger('q2_6')->nullable();
            $table->tinyInteger('q2_7')->nullable();
            $table->tinyInteger('q2_8')->nullable();
            $table->tinyInteger('q2_9')->nullable();
            $table->tinyInteger('q2_10')->nullable();
            $table->tinyInteger('q2_11')->nullable();
            $table->tinyInteger('q2_12')->nullable();
            $table->tinyInteger('q2_13')->nullable();
            $table->tinyInteger('q2_14')->nullable();
            $table->tinyInteger('q2_15')->nullable();
            $table->tinyInteger('q2_16')->nullable();

            // Bloque 3: q3_1 hasta q3_10
            $table->tinyInteger('q3_1')->nullable();
            $table->tinyInteger('q3_2')->nullable();
            $table->tinyInteger('q3_3')->nullable();
            $table->tinyInteger('q3_4')->nullable();
            $table->tinyInteger('q3_5')->nullable();
            $table->tinyInteger('q3_6')->nullable();
            $table->tinyInteger('q3_7')->nullable();
            $table->tinyInteger('q3_8')->nullable();
            $table->tinyInteger('q3_9')->nullable();
            $table->tinyInteger('q3_10')->nullable();

            // Bloque 4: q4_1 hasta q4_10
            $table->tinyInteger('q4_1')->nullable();
            $table->tinyInteger('q4_2')->nullable();
            $table->tinyInteger('q4_3')->nullable();
            $table->tinyInteger('q4_4')->nullable();
            $table->tinyInteger('q4_5')->nullable();
            $table->tinyInteger('q4_6')->nullable();
            $table->tinyInteger('q4_7')->nullable();
            $table->tinyInteger('q4_8')->nullable();
            $table->tinyInteger('q4_9')->nullable();
            $table->tinyInteger('q4_10')->nullable();

            // Bloque 5: q5_1 hasta q5_10
            $table->tinyInteger('q5_1')->nullable();
            $table->tinyInteger('q5_2')->nullable();
            $table->tinyInteger('q5_3')->nullable();
            $table->tinyInteger('q5_4')->nullable();
            $table->tinyInteger('q5_5')->nullable();
            $table->tinyInteger('q5_6')->nullable();
            $table->tinyInteger('q5_7')->nullable();
            $table->tinyInteger('q5_8')->nullable();
            $table->tinyInteger('q5_9')->nullable();
            $table->tinyInteger('q5_10')->nullable();

            // Comentarios finales
            $table->text('comments')->nullable();

            // Timestamps
            $table->timestamps();
        });
    }

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