<?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_table6', function (Blueprint $table) {
            $table->id('DatasetTable6Id');
            $table->integer('dataset_id');
            $table->string('kabupaten_kota')->nullable();
            $table->float('kritis_hutan')->default(0);
            $table->float('kritis_non_hutan')->default(0);
            $table->float('sangat_kritis_hutan')->default(0);
            $table->float('sangat_kritis_non_hutan')->default(0);
            $table->float('potensial_kritis_hutan')->default(0);
            $table->float('potensial_kritis_non_hutan')->default(0);
            $table->float('agak_kritis_hutan')->default(0);
            $table->float('agak_kritis_non_hutan')->default(0);
            $table->float('tidak_agak_kritis_hutan')->default(0);
            $table->float('tidak_agak_kritis_non_hutan')->default(0);
            $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_table6s');
    }
};
