<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('locations', function (Blueprint $table) {
            $table->id();
            $table->string('name')->unique(); // z.B. "Dresden", "Berlin"
            $table->string('slug')->unique(); // z.B. "dresden", "berlin"
            $table->text('description')->nullable(); // Optional: Beschreibung des Ortes
            $table->string('city')->nullable(); // Stadt/Region
            $table->string('country')->default('Germany'); // Land
            $table->decimal('latitude', 10, 8)->nullable(); // GPS-Koordinaten
            $table->decimal('longitude', 11, 8)->nullable();
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('locations');
    }
};
