<?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_table53', function (Blueprint $table) {
            $table->id('DatasetTable53Id');
            $table->integer('dataset_id');
            $table->string('nama_instansi')->nullable(); // Nama instansi
            $table->string('jabatan_fungsional')->nullable(); // Nama jabatan fungsional
            $table->integer('laki_laki')->default(0); // jumlah staf laki-laki
            $table->integer('perempuan')->default(0); // jumlah staf perempuan
            $table->integer('staf_diklat_l')->default(0); // staf laki-laki yang sudah diklat
            $table->integer('staf_diklat_p')->default(0); // staf perempuan yang sudah diklat
            $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_table53s');
    }
};
