<?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_table27', function (Blueprint $table) {
            $table->id('DatasetTable27Id');
            $table->integer('dataset_id');
            $table->string('nama_sungai')->nullable();  // Nama Sungai
            $table->string('lokasi')->nullable();       // Lokasi
            $table->float('panjang')->default(0);         // Panjang (km)
            $table->float('lebar_permukaan')->default(0);  // Lebar Permukaan (m)
            $table->float('lebar_dasar')->default(0);      // Lebar Dasar (m)
            $table->float('kedalaman')->default(0);        // Kedalaman (m)
            $table->float('debit_maks')->default(0);   // Debit Maks (m³/dtk)
            $table->float('debit_min')->default(0);    // Debit Min (m³/dtk)
            $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_table27s');
    }
};
