<?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::table('profile_fields', function (Blueprint $table) {
            $table->boolean('is_required')->default(false)->after('options');
            $table->boolean('is_visible')->default(true)->after('is_searchable');
            $table->string('default_value')->nullable()->after('is_visible');
            $table->integer('order')->default(0)->after('default_value');
        });
    }

    public function down(): void
    {
        Schema::table('profile_fields', function (Blueprint $table) {
            $table->dropColumn(['is_required', 'is_visible', 'default_value', 'order']);
        });
    }
};
