<?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_table44b', function (Blueprint $table) {
            $table->id('DatasetTable44BId');
            $table->integer('dataset_id');
            $table->string('lokasi')->nullable();
            $table->string('jumlah_kejadian')->nullable();
            $table->string('terdampak')->nullable();
            $table->string('kecamatan')->nullable();
            $table->string('kelurahan')->nullable();
            $table->string('rt')->nullable();
            $table->string('rw')->nullable();
            $table->string('kk')->nullable();
            $table->string('jiwa')->nullable();
            $table->string('pengungsi')->nullable();
            $table->string('lokasi_pengungsian')->nullable();
            $table->string('korban_jiwa_luka')->nullable();
            $table->string('keterangan')->nullable();
            $table->string('kerugian')->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_table44_b_s');
    }
};
