changed migrations

This commit is contained in:
m.zargarov 2024-05-08 12:03:55 +04:00
parent 7a80e52d3c
commit 1a0cf48515
2 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,10 @@ return new class extends Migration
$table->id();
$table->string('name');
$table->string('type');
$table->date('lesson_date')->nullable();
$table->date('lesson_date');
$table->foreignId('grade_id')->constrained('grades')->onDelete('cascade');
$table->foreignId('subject_id')->constrained('subjects')->onDelete('cascade');
$table->foreignId('teacher_id')->constrained('teachers')->onDelete('cascade');
$table->timestamps();
});
}

View File

@ -12,7 +12,7 @@ return new class extends Migration
public function up(): void
{
Schema::table('student_subject', function (Blueprint $table) {
$table->foreignId('lesson_id')->constrained('lessons')->onDelete('cascade');
$table->foreignId('lesson_id')->nullable()->constrained('lessons')->onDelete('cascade');
});
}