<?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('sampah_terkelola', function (Blueprint $table) {
            $table->id('SampahTerkelolaId');
            $table->integer('ms_sekolah_id');
            $table->year('tahun');
            $table->integer('bulan');
            $table->string('organik');
            $table->string('sampah_anorganik');
            $table->string('b3');
            $table->string('minyak_jelantah');
            $table->timestampsTz();
            $table->softdeletesTz();

            $table->foreign('ms_sekolah_id')->references('MsSekolahId')->on('ms_sekolah')->onDelete('cascade');
        });
    }

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