From 25d6e52f176ae82d1a6d1f22887f93909fb1bc70 Mon Sep 17 00:00:00 2001 From: Lucas Henrique Date: Wed, 14 Dec 2022 16:24:26 -0300 Subject: [PATCH] =?UTF-8?q?Migra=C3=A7=C3=B5es=20para=20criar=20as=20tabel?= =?UTF-8?q?as=20campo=5Favaliacaos=20e=20avaliacao=5Ftrabalhos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...4_154533_create_campo_avaliacaos_table.php | 39 +++++++++++++++++ ...54948_create_avaliacao_trabalhos_table.php | 42 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 database/migrations/2022_12_14_154533_create_campo_avaliacaos_table.php create mode 100644 database/migrations/2022_12_14_154948_create_avaliacao_trabalhos_table.php diff --git a/database/migrations/2022_12_14_154533_create_campo_avaliacaos_table.php b/database/migrations/2022_12_14_154533_create_campo_avaliacaos_table.php new file mode 100644 index 0000000..8ac2e48 --- /dev/null +++ b/database/migrations/2022_12_14_154533_create_campo_avaliacaos_table.php @@ -0,0 +1,39 @@ +bigIncrements('id'); + $table->string('nome')->nullable(); + $table->float('nota_maxima')->nullable(); + $table->text('descricao')->nullable(); + $table->integer('prioridade')->nullable(); + + $table->integer('evento_id'); + $table->foreign('evento_id')->references('id')->on('eventos'); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('campo_avaliacaos'); + } +} diff --git a/database/migrations/2022_12_14_154948_create_avaliacao_trabalhos_table.php b/database/migrations/2022_12_14_154948_create_avaliacao_trabalhos_table.php new file mode 100644 index 0000000..0ea0122 --- /dev/null +++ b/database/migrations/2022_12_14_154948_create_avaliacao_trabalhos_table.php @@ -0,0 +1,42 @@ +bigIncrements('id'); + $table->float('nota')->nullable(); + + $table->integer('avaliador_id'); + $table->foreign('avaliador_id')->references('id')->on('avaliadors'); + + $table->integer('campo_avaliacao_id'); + $table->foreign('campo_avaliacao_id')->references('id')->on('campo_avaliacaos'); + + $table->integer('trabalho_id'); + $table->foreign('trabalho_id')->references('id')->on('trabalhos'); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('avaliacao_trabalhos'); + } +} -- GitLab