<?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('berkas_skp', function (Blueprint $table) {
            $table->id();
            $table->string('judul')->comment('judul kegiatan');
            $table->string('lokasi');
            $table->string('nomor_sertifikat')->nullable();
            $table->date('tanggal_mulai')->nullable();
            $table->date('tanggal_akhir')->nullable();
            $table->foreignId('kegiatan_skp_id')->constrained('kegiatan_skp')->onDelete('cascade');
            $table->foreignId('berkas_sidang')->constrained('sidang')->onDelete('cascade');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('berkas_skp');
    }
};