<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up(): void {
        Schema::create('pregunta_tipos', function (Blueprint $table) {
            $table->id();
            $table->string('nombre');
            $table->string('slug')->unique();
        });
        DB::table('pregunta_tipos')->insert([
            ['nombre' => 'Texto libre',        'slug' => 'texto_libre'],
            ['nombre' => 'Opcion multiple',    'slug' => 'opcion_multiple'],
            ['nombre' => 'Escala del 1 al 5',  'slug' => 'escala_5'],
            ['nombre' => 'Escala del 1 al 10', 'slug' => 'escala_10'],
            ['nombre' => 'Si o No',            'slug' => 'si_no'],
        ]);
    }
    public function down(): void { Schema::dropIfExists('pregunta_tipos'); }
};
