GermanAirlinesVA-Schooling/updates/builder_table_create_exam_answers.php
2021-08-14 18:30:00 +02:00

30 lines
907 B
PHP

<?php namespace GermanAirlinesVa\Schooling\Updates;
use Schema;
use October\Rain\Database\Updates\Migration;
class BuilderTableCreateExamAnswers extends Migration
{
public function up()
{
Schema::connection('germanairlinesva_schooling')->create('exam_answers', function ($table) {
$table->engine = 'InnoDB';
$table->bigIncrements('id')->unsigned();
$table->bigInteger('exam_question_id')->unsigned();
$table
->foreign('exam_question_id')
->references('id')
->on('exam_questions');
$table->text('text');
$table->boolean('is_correct');
});
}
public function down()
{
Schema::connection('germanairlinesva_schooling')->disableForeignKeyConstraints();
Schema::connection('germanairlinesva_schooling')->dropIfExists('exam_answers');
Schema::connection('germanairlinesva_schooling')->enableForeignKeyConstraints();
}
}