<?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('class_room_activities', function (Blueprint $table) {
    //     $table->id();

    //     $table->string('date_epoch');
    //     $table->string('classroomId');
    //     $table->string('scheduleId');

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

    Schema::create('class_room_activities', function (Blueprint $table) {
      $table->id();

      $table->unsignedBigInteger('class_room_id');
      $table
        ->foreign('class_room_id')
        ->references('id')
        ->on('class_rooms')
        ->onDelete('cascade');

      $table->unsignedBigInteger('schedule_id');
      $table
        ->foreign('schedule_id')
        ->references('id')
        ->on('schedules')
        ->onDelete('cascade');

      $table->string('date_epoch');
      $table->timestamps();
    });
  }

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