<?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->enum('role', ['admin', 'escort'])->default('escort')->after('email');
            $table->string('phone', 20)->nullable()->after('role');
            $table->string('city', 100)->nullable()->after('phone');
            $table->string('state', 100)->nullable()->after('city');
            $table->decimal('lat', 10, 7)->nullable()->after('state');
            $table->decimal('lng', 10, 7)->nullable()->after('lat');
            $table->boolean('is_active')->default(true)->after('lng');
            $table->boolean('is_verified')->default(false)->after('is_active');
            $table->string('avatar')->nullable()->after('is_verified');
        });
    }

    public function down(): void
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn(['role','phone','city','state','lat','lng','is_active','is_verified','avatar']);
        });
    }
};
