Explorar o código

Доделаны миграции

aloparev %!s(int64=3) %!d(string=hai) anos
pai
achega
b0159cf0ee

+ 4 - 7
src/server/database/migrations/2021_05_25_042104_create_courses_table.php

@@ -19,18 +19,15 @@ class CreateCoursesTable extends Migration
             $table->string('name');
             $table->integer('price');
             $table->integer('period');
-            $table->string('email');
-            $table->string('program');
-            $table->string('places');
+            $table->string('forma');
+            $table->string('level');
             $table->integer('hours');
-            $table->string('documents');
-            $table->string('education_place');
-            $table->string('contact_ed');
-            $table->string('contact');
             $table->unsignedBigInteger('teacher_id');
+            $table->unsignedBigInteger('organisation_id');
             $table->timestamps();
 
             $table->foreign('teacher_id')->on('teachers')->references('id');
+            $table->foreign('organisation_id')->on('organisations')->references('id');
         });
     }
 

+ 7 - 0
src/server/database/migrations/2021_05_28_075639_create_organisations_table.php

@@ -15,7 +15,14 @@ class CreateOrganisationsTable extends Migration
     {
         Schema::create('organisations', function (Blueprint $table) {
             $table->id();
+            $table->string('name');
+            $table->string('email');
+            $table->string('address');
+            $table->string('boss');
+            $table->unsignedBigInteger('teacher_id');
             $table->timestamps();
+
+            $table->foreign('teacher_id')->on('teachers')->references('id');
         });
     }