This commit is contained in:
Kilian committed 2021-08-13 21:08:59 +02:00
1 parent 837d86ae21
commit 77799b26cc
8 files changed
+53 -60

No files matched your search

@@ -5,34 +5,33 @@ 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();
}
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();
}
}