<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tbl_admissions', function (Blueprint $table) {
            $table->id(); // Primary key
            $table->unsignedBigInteger('student_id'); // Foreign key to 'tbl_courses'
            $table->unsignedBigInteger('course_id'); // Foreign key to 'tbl_courses'
            $table->date('admission_date'); // Admission date
            $table->timestamps(); // 'created_at' and 'updated_at' columns

            // Define the foreign key constraint
           // $table->foreign('course_id')->references('id')->on('tbl_courses')->onDelete('cascade');
        });
    }

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