<?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('lokasi_tps', function (Blueprint $table) {
            $table->id();

            $table->foreignId('kategori_tps_id')
                ->constrained('kategori_tps')
                ->onDelete('cascade');

            $table->string('nama_tps');
            $table->string('status_tps');
            $table->year('tahun_pembuatan');
            $table->integer('kapasitas_tps');

            $table->decimal('latitude', 10, 7);
            $table->decimal('longitude', 10, 7);

            $table->string('foto_tps')->nullable();

            $table->timestamps();
        });
    }

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