<?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_table23', function (Blueprint $table) {
            $table->id('DatasetTable23Id');
            $table->integer('dataset_id');
            $table->string('lokasi')->nullable();
            $table->date('waktu')->nullable();
            $table->string('lat')->nullable();
            $table->string('long')->nullable();
            $table->string('lokasi_sampling')->nullable();
            $table->string('warna')->nullable();
            $table->string('kecerahan')->nullable();
            $table->string('kekeruhan')->nullable();
            $table->string('tss')->nullable();
            $table->string('sampah')->nullable();
            $table->string('lapisan_minyak')->nullable();
            $table->string('tempratur')->nullable();
            $table->string('ph')->nullable();
            $table->string('salinitas')->nullable();
            $table->string('do')->nullable();
            $table->string('bod5')->nullable();
            $table->string('cod')->nullable();
            $table->string('amonia_total')->nullable();
            $table->string('no2n')->nullable();
            $table->string('no3n')->nullable();
            $table->string('po4p')->nullable();
            $table->string('sianida')->nullable();
            $table->string('sulfida')->nullable();
            $table->string('klor')->nullable();
            $table->string('minyak_bumi')->nullable();
            $table->string('fenol')->nullable();
            $table->string('pestisida')->nullable();
            $table->string('pcb')->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_table23s');
    }
};
