<?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_table50a', function (Blueprint $table) {
            $table->id('DatasetTable50AId');
            $table->integer('dataset_id');
            $table->string('kanal_aduan')->nullable();
            $table->string('nama_skpd')->nullable();
            $table->string('kategori')->nullable();
            $table->text('rincian_masalah')->nullable();
            $table->float('bobot')->default(0);
            $table->date('tgl_masuk')->nullable();
            $table->date('tgl_tl')->nullable();
            $table->string('status')->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_table50_a_s');
    }
};
