<?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
    {
        // Add answer_type to make unique answer per question
        Schema::table('question_answers', function (Blueprint $table) {
            $table->string('answer_type')->after('question_id')->nullable(); // answer_type
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        // remove answer_type
        Schema::table('question_answers', function (Blueprint $table) {
            $table->dropColumn('answer_type'); // answer_type
        });
    }
};
