Commit 25d6e52f authored by Lucas Henrique's avatar Lucas Henrique
Browse files

Migrações para criar as tabelas campo_avaliacaos e avaliacao_trabalhos

parent 467aa5ea
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCampoAvaliacaosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('campo_avaliacaos', function (Blueprint $table) {
$table->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');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAvaliacaoTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('avaliacao_trabalhos', function (Blueprint $table) {
$table->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');
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment