diff --git a/models/ExamMemberRank.php b/models/ExamMemberRank.php index 98e623b..a104c0c 100644 --- a/models/ExamMemberRank.php +++ b/models/ExamMemberRank.php @@ -56,11 +56,11 @@ class ExamMemberRank extends Model * @return void */ protected static function boot() - { + { parent::boot(); static::addGlobalScope('exam_member_rank_member_rank_id', function ($builder) { $builder->where('member_rank_id', '<>', null); }); - } + } } diff --git a/models/ExamMemberRankAnswer.php b/models/ExamMemberRankAnswer.php index 1f2feb3..29e3adb 100644 --- a/models/ExamMemberRankAnswer.php +++ b/models/ExamMemberRankAnswer.php @@ -43,7 +43,7 @@ class ExamMemberRankAnswer extends Model ], ]; - /** + /** * The "booting" method of the model. * * @return void diff --git a/models/ExamMemberRankQuestion.php b/models/ExamMemberRankQuestion.php index 637db74..ac94375 100644 --- a/models/ExamMemberRankQuestion.php +++ b/models/ExamMemberRankQuestion.php @@ -32,10 +32,7 @@ class ExamMemberRankQuestion extends Model ]; public $hasMany = [ - 'exam_answers' => [ - 'GermanAirlinesVa\Schooling\Models\ExamMemberRankAnswer', - 'key' => 'exam_question_id', - ], + 'exam_answers' => ['GermanAirlinesVa\Schooling\Models\ExamMemberRankAnswer', 'key' => 'exam_question_id'], ]; public $belongsTo = [ diff --git a/models/ExamTyperating.php b/models/ExamTyperating.php index 89958ce..78ef19c 100644 --- a/models/ExamTyperating.php +++ b/models/ExamTyperating.php @@ -36,7 +36,7 @@ class ExamTyperating extends Model ]; public $belongsToMany = [ - 'exam_questions' => [ + 'exam_questions' => [ 'GermanAirlinesVa\Schooling\Models\ExamTyperatingQuestion', 'table' => 'exam_exam_answer_exam_question', 'key' => 'exam_id', diff --git a/models/ExamTyperatingQuestion.php b/models/ExamTyperatingQuestion.php index ce71308..8157f71 100644 --- a/models/ExamTyperatingQuestion.php +++ b/models/ExamTyperatingQuestion.php @@ -32,10 +32,7 @@ class ExamTyperatingQuestion extends Model ]; public $hasMany = [ - 'exam_answers' => [ - 'GermanAirlinesVa\Schooling\Models\ExamTyperatingAnswer', - 'key' => 'exam_question_id', - ], + 'exam_answers' => ['GermanAirlinesVa\Schooling\Models\ExamTyperatingAnswer', 'key' => 'exam_question_id'], ]; public $belongsTo = [ @@ -51,7 +48,7 @@ class ExamTyperatingQuestion extends Model ], ]; - /** + /** * The "booting" method of the model. * * @return void diff --git a/updates/builder_table_create_exam_exam_answer_exam_question.php b/updates/builder_table_create_exam_exam_answer_exam_question.php index 4c440c7..0b17980 100644 --- a/updates/builder_table_create_exam_exam_answer_exam_question.php +++ b/updates/builder_table_create_exam_exam_answer_exam_question.php @@ -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(); + } } diff --git a/updates/version.yaml b/updates/version.yaml index 342d4c8..8f5d8b3 100644 --- a/updates/version.yaml +++ b/updates/version.yaml @@ -1,17 +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 exam_exam_answer_exam_question' - - builder_table_create_exam_exam_answer_exam_question.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 diff --git a/yarn.lock b/yarn.lock index 61e15f7..9a37e54 100644 --- a/yarn.lock +++ b/yarn.lock @@ -41,9 +41,9 @@ p-defer@^1.0.0: resolved "https://registry.yarnpkg.com/p-defer/-/p-defer-1.0.0.tgz#9f6eb182f6c9aa8cd743004a7d4f96b196b0fb0c" integrity sha1-n26xgvbJqozXQwBKfU+WsZaw+ww= -"php-parser@git+https://github.com/glayzzle/php-parser.git#e61e26102144f267ecf5e09020865a9baa6ca2f1": +"php-parser@https://github.com/glayzzle/php-parser#e61e26102144f267ecf5e09020865a9baa6ca2f1": version "3.0.2" - resolved "git+https://github.com/glayzzle/php-parser.git#e61e26102144f267ecf5e09020865a9baa6ca2f1" + resolved "https://github.com/glayzzle/php-parser#e61e26102144f267ecf5e09020865a9baa6ca2f1" prettier@^2.3.2: version "2.3.2"