sistem-akademik/database/migrations/2025_04_30_125442_create_assessments_table.php
2025-05-01 19:51:32 +07:00

33 lines
798 B
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('assessments', function (Blueprint $table) {
$table->id();
$table->foreignId('teacher_subject_id')->constrained('teacher_subjects');
$table->foreignId('student_id')->constrained('students');
$table->float('score');
$table->timestamps();
$table->unique(['teacher_subject_id', 'student_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('assessments');
}
};