|
@@ -0,0 +1,35 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
+
|
|
|
+class CreateCoursesTeachersTable extends Migration
|
|
|
+{
|
|
|
+ /**
|
|
|
+ * Run the migrations.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function up()
|
|
|
+ {
|
|
|
+ Schema::create('courses_teachers', function (Blueprint $table) {
|
|
|
+ $table->id();
|
|
|
+ $table->unsignedBigInteger('courses_id');
|
|
|
+ $table->unsignedBigInteger('teachers_id');
|
|
|
+
|
|
|
+ $table->foreign('courses_id')->references('id')->on('courses');
|
|
|
+ $table->foreign('teachers_id')->references('id')->on('teachers');
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Reverse the migrations.
|
|
|
+ *
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ public function down()
|
|
|
+ {
|
|
|
+ Schema::dropIfExists('courses_teachers');
|
|
|
+ }
|
|
|
+}
|