<?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
    {
        // Tabel ini akan menyimpan fitur-fitur sistem perkuliahan 
        // yang ditampilkan di halaman landing page per kampus.
        Schema::create('sistem_perkuliahan', function (Blueprint $table) {
            $table->id();
            // Foreign key ke tabel 'campuses'.
            $table->foreignId('campus_id')->constrained()->onDelete('cascade');
            
            $table->string('name', 100); // Nama Fitur, contoh: 'Hybrid Learning'
            // KOLOM 'icon' TELAH DIHAPUS SESUAI PERMINTAAN
            $table->text('description'); // Deskripsi detail fitur
            
            // Status untuk mengontrol tampilan (aktif/non-aktif) di front-end
            $table->boolean('is_active')->default(true); 
            
            $table->timestamps();
            
            $table->index('campus_id');
        });
    }

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