<?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_table25', function (Blueprint $table) {
            $table->id('DatasetTable25Id');
            $table->integer('dataset_id');
            $table->string('lokasi')->nullable();
            $table->float('mata_air')->default(0); // Mata Air
            $table->float('ledeng_pam')->default(0); // Ledeng/PAM
            $table->float('sumur_bor_pompa')->default(0); // Sumur Bor/Pompa
            $table->float('sumur_tak_terlindung')->default(0); // Sumur Tak Terlindung
            $table->float('sungai')->default(0); // Sungai
            $table->float('terlindung_air')->default(0); 
            $table->float('air_kemasan')->default(0); 
            $table->string('lainnya')->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_table25s');
    }
};
