<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::table('user_profiles', function (Blueprint $table) {
            // Tambah gender dan birth_date (birth_month sudah tidak ada)
            if (!Schema::hasColumn('user_profiles', 'gender')) {
                $table->string('gender')->nullable()->after('email');
            }
            if (!Schema::hasColumn('user_profiles', 'birth_date')) {
                $table->date('birth_date')->nullable()->after('gender');
            }
        });
    }

    public function down(): void
    {
        Schema::table('user_profiles', function (Blueprint $table) {
            $table->dropColumn(['gender', 'birth_date']);
        });
    }
};
