| Current Path : /var/www/html/LLCF-APP/database/migrations/ |
| Current File : //var/www/html/LLCF-APP/database/migrations/2025_08_03_185426_create_attendance_table.php |
<?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('attendance', function (Blueprint $table) {
$table->unsignedBigInteger('student_id');
$table->string('class', 10);
$table->date('date');
$table->string('attendance', 1);
$table->timestamp('created_on')->useCurrent();
$table->timestamp('updated_on')->nullable()->useCurrentOnUpdate();
$table->unique(['student_id', 'class', 'date'], 'attendance_key');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('attendance');
}
};