<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Modules\Lpj\Models\Inspeksi;

return new class () extends Migration {
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('penilai', function (Blueprint $table) {
            $table->dropForeign(['inspeksi_id']);
            $table->dropColumn('inspeksi_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('penilai', function (Blueprint $table) {
            $table->unsignedBigInteger('inspeksi_id')->nullable();
            $table->foreign('inspeksi_id')->references('id')->on('inspeksi')->onDelete('cascade');
        });
    }
};
