<?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_table37', function (Blueprint $table) {
            $table->id('DatasetTable37Id');
            $table->integer('dataset_id');
            $table->string('lokasi')->nullable();
            $table->string('lat')->nullable();
            $table->string('long')->nullable();
            $table->string('lama_pengukuran')->nullable();
            $table->string('so2')->nullable();   // µg/Nm3
            $table->string('co')->nullable();    // µg/Nm3
            $table->string('no2')->nullable();   // µg/Nm3
            $table->string('o3')->nullable();    // µg/Nm3
            $table->string('hc')->nullable();    // µg/Nm3
            $table->string('pm10')->nullable();  // µg/Nm3
            $table->string('pm25')->nullable();  // µg/Nm3
            $table->string('tsp')->nullable();   // µg/Nm3
            $table->string('pb')->nullable();    // µg/Nm3
            $table->string('dustfall')->nullable(); // µg/Nm3
            $table->string('total_fluorides')->nullable(); // µg/Nm3
            $table->string('fluor_index')->nullable();     // µg/Nm3
            $table->string('chlorine_dioxide')->nullable(); // µg/Nm3
            $table->string('sulphat_index')->nullable();    // µg/Nm3
            $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_table37s');
    }
};
