<?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('programmes', function (Blueprint $table) {
            $table->id();
            $table->string('code', 20)->unique(); // e.g., CA-DIP-001
            $table->string('description');        // e.g., Diploma in Culinary Arts
            $table->unsignedInteger('total_credits')->default(0);
            $table->unsignedInteger('duration')->comment('Duration in years');
            $table->enum('status', ['ongoing', 'completed', 'deferred'])->default('ongoing');
            $table->timestamps();
        });
    }

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