<?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('nationality', 2)->nullable()->after('gender');   // ISO2 e.g. "BH"
            $table->string('phone_code', 20)->nullable()->after('nationality'); // e.g. "+973|BH"
            $table->string('phone_number', 30)->nullable()->after('phone_code');
            $table->string('timezone', 60)->nullable()->after('phone_number'); // IANA e.g. "Asia/Bahrain"
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn(['nationality', 'phone_code', 'phone_number', 'timezone']);
        });
    }
};
