Exam Table/Model/Controller

This commit is contained in:
Your Name
2021-08-04 14:01:21 +02:00
parent 38efe1af1b
commit 42e06d1005
18 changed files with 278 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
<?php namespace GermanAirlinesVa\Schooling\Updates;
use DB;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateExams extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_schooling')->create('exams', function ($table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('member_id')->unsigned();
$table
->bigInteger('member_rank_id')
->unsigned()
->nullable();
$table
->foreign('member_rank_id')
->references('id')
->on('member_ranks');
$table
->bigInteger('typerating_id')
->unsigned()
->nullable();
$table
->foreign('typerating_id')
->references('id')
->on('typeratings');
$table->datetime('start')->default(DB::raw('NOW()'));
$table->enum('status', ['pending', 'validated', 'closed', 'open']);
});
}
public function down()
{
Schema::connection('germanairlinesva_schooling')->dropIfExists('exams');
}
}
+2
View File
@@ -11,3 +11,5 @@
- builder_table_create_exam_questions.php
- 'Created table exam_answers'
- builder_table_create_exam_answers.php
- 'Created table exams'
- builder_table_create_exams.php