<?php

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

return new class extends Migration
{
    /**
     * Add latitude and longitude columns to health_institutions for Leaflet.js geo map.
     */
    public function up(): void
    {
        Schema::table('health_institutions', function (Blueprint $table) {
            $table->decimal('latitude', 10, 7)->nullable()->after('country')
                ->comment('GPS latitude for geo density map');
            $table->decimal('longitude', 10, 7)->nullable()->after('latitude')
                ->comment('GPS longitude for geo density map');
        });
    }

    public function down(): void
    {
        Schema::table('health_institutions', function (Blueprint $table) {
            $table->dropColumn(['latitude', 'longitude']);
        });
    }
};
