Added cascade to students

This commit is contained in:
m.zargarov 2024-05-03 13:13:42 +04:00
parent b63b97e54d
commit f13fb375e7

View File

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