<?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('users', function (Blueprint $table) {
            $table->string('gender', 10)->nullable();
            $table->boolean('is_legacy_password')->default(false);
            $table->string('wa_customer_id', 20)->nullable();
            $table->string('legacy_id', 20)->nullable();
            $table->timestamp('registered_at')->nullable();
            $table->string('salutation', 100)->nullable()->change();
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn(['gender', 'is_legacy_password', 'wa_customer_id', 'legacy_id', 'registered_at']);
            $table->string('salutation', 10)->nullable()->change();
        });
    }
};
