<?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_table16', function (Blueprint $table) {
            $table->id('DatasetTable16Id');
            $table->integer('dataset_id');
            $table->string('kabupaten_kota')->nullable();
            $table->string('lokasi_penanaman')->nullable();
            $table->float('penghijauan_target')->default(0);
            $table->float('penghijauan_luas_realisasi')->default(0);
            $table->integer('penghijauan_realisasi_jumlah_pohon')->default(0);
            $table->integer('penghijauan_jumlah_pohon_hidup')->default(0);
            $table->float('reboisasi_target')->default(0);
            $table->float('reboisasi_luas_realisasi')->default(0);
            $table->integer('reboisasi_realisasi_jumlah_pohon')->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_table16s');
    }
};
