<?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::create('department_municipalities', function (Blueprint $table) {
            $table->id();
            $table->string('department_code', 5);
            $table->string('department_name', 100)->index(); // Índice para búsquedas rápidas
            $table->string('municipality_code', 5)->unique();
            $table->string('municipality_name', 100);
            $table->string('type', 50)->nullable();
            $table->decimal('longitude', 10, 7)->nullable();
            $table->decimal('latitude', 10, 7)->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('department_municipalities');
    }
};
