<?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()
{
    Schema::table('questions', function (Blueprint $table) {
        $table->string('option1')->nullable()->change();
        $table->string('option2')->nullable()->change();
        $table->string('option3')->nullable()->change();
        $table->string('option4')->nullable()->change();

        $table->string('type')->default('quiz');
    });
}

    /**
     * Reverse the migrations.
     */
public function down()
{
    Schema::table('questions', function (Blueprint $table) {
        $table->string('option1')->nullable(false)->change();
        $table->string('option2')->nullable(false)->change();
        $table->string('option3')->nullable(false)->change();
        $table->string('option4')->nullable(false)->change();

        $table->dropColumn('type');
    });
}
};
