<?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_table35', function (Blueprint $table) {
            $table->id('DatasetTable35Id');
            $table->integer('dataset_id');
            $table->string('sumber_pencemaran')->nullable();
            $table->string('lokasi')->nullable();
            $table->string('tipe_jenis_klasifikasi')->nullable();
            $table->float('luas')->default(0); // Ha
            $table->float('volume_limbah_padat')->default(0); // ton/hari
            $table->float('volume_air_limbah')->default(0); // m3/hari
            $table->float('jumlah_limbah_b3_padat')->default(0); // ton/tahun
            $table->float('jumlah_limbah_b3_cair')->default(0); // m3/tahun
            $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_table35s');
    }
};
