bigIncrements('id'); $table->char('semester_code', 3); $table->unsignedBigInteger('course_id'); $table->char('code', 3); $table->unsignedInteger('student_count')->nullable(); $table->string('syllabus')->nullable(); $table->unsignedDecimal('credits')->nullable(); $table->unsignedDecimal('quota')->nullable(); $table->foreign('semester_code')->references('code')->on('semesters'); $table->foreign('course_id')->references('id')->on('courses')->onUpdate('cascade'); $table->unique(['semester_code', 'course_id', 'code']); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('sections'); } }