Exam Question/Answer 3-way m:n

This commit is contained in:
2021-08-13 21:07:55 +02:00
parent aa073a5029
commit 837d86ae21
17 changed files with 226 additions and 51 deletions
@@ -0,0 +1,38 @@
<?php namespace GermanAirlinesVa\Schooling\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateExamExamAnswerExamQuestion extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_schooling')->create('exam_exam_answer_exam_question', function($table)
{
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('exam_id')->unsigned();
$table
->foreign('exam_id')
->references('id')
->on('exams');
$table->bigInteger('exam_answer_id')->unsigned();
$table
->foreign('exam_answer_id')
->references('id')
->on('exam_answers');
$table->bigInteger('exam_question_id')->unsigned();
$table
->foreign('exam_question_id')
->references('id')
->on('exam_questions');
});
}
public function down()
{
Schema::connection('germanairlinesva_schooling')->disableForeignKeyConstraints();
Schema::dropIfExists('germanairlinesva_schooling_exam_exam_answer_exam_question');
Schema::connection('germanairlinesva_schooling')->disableForeignKeyConstraints();
}
}
+15 -13
View File
@@ -1,15 +1,17 @@
1.0.1:
- 'Initialize plugin.'
- 'Create table deferred_bindings'
- builder_table_create_deferred_bindings.php
- 'Initialize plugin.'
- 'Create table deferred_bindings'
- builder_table_create_deferred_bindings.php
1.0.2:
- 'Created table typeratings'
- builder_table_create_typeratings.php
- 'Created table member_ranks'
- builder_table_create_member_ranks.php
- 'Created table exam_questions'
- builder_table_create_exam_questions.php
- 'Created table exam_answers'
- builder_table_create_exam_answers.php
- 'Created table exams'
- builder_table_create_exams.php
- 'Created table typeratings'
- builder_table_create_typeratings.php
- 'Created table member_ranks'
- builder_table_create_member_ranks.php
- 'Created table exam_questions'
- builder_table_create_exam_questions.php
- 'Created table exam_answers'
- builder_table_create_exam_answers.php
- 'Created table exams'
- builder_table_create_exams.php
- 'Created table exam_exam_answer_exam_question'
- builder_table_create_exam_exam_answer_exam_question.php