<?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('students', function (Blueprint $table) {
            $table->id();
            $table->string('kohort');               // contoh: 2024/2025
            $table->string('program');              // contoh: TM, TK, Auto
            $table->string('kelas');  
            $table->string('peringkat');                // contoh: PMR, UPSR, PT3, SPM, STPM, DIPLOMA, UEC

            // Bilangan jantina mengikut kelas
            $table->unsignedInteger('bil_lelaki')->default(0);
            $table->unsignedInteger('bil_perempuan')->default(0);

            // Status pelajar asrama (bilangan mengikut kelas)
            $table->unsignedInteger('bil_asrama_lelaki')->default(0);
            $table->unsignedInteger('bil_asrama_perempuan')->default(0);
            $table->unsignedInteger('bil_bukan_asrama')->default(0);

            // Agama mengikut kelas
            $table->unsignedInteger('agama_islam')->default(0);
            $table->unsignedInteger('agama_bukan_islam')->default(0);

            // Kaum mengikut kelas
            $table->unsignedInteger('kaum_melayu')->default(0);
            $table->unsignedInteger('kaum_cina')->default(0);
            $table->unsignedInteger('kaum_india')->default(0);
            $table->unsignedInteger('kaum_lain')->default(0);

            $table->timestamps();
        });
    }

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

