<?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('dataset_table47', function (Blueprint $table) {
            $table->id('DatasetTable47Id');
            $table->integer('dataset_id');
            $table->string('kabupaten_kota')->nullable();
            $table->string('lokasi')->nullable();
            $table->float('jumlah_penduduk')->default(0);
            $table->float('timbulan_sampah')->default(0);
            $table->string('status_open_dumping')->nullable();
            $table->string('status_sanitary_landfill')->nullable();
            $table->string('status_controlled_landfill')->nullable();
            $table->integer('created_by');
            $table->timestampsTz();
            $table->softdeletesTz();

            $table->foreign('dataset_id')->references('DatasetId')->on('dataset')->cascadeOnDelete();
        });
    }

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