Commit 0fb4cdf0 authored by unknown's avatar unknown
Browse files

criações das tabelas para fazer a relação entre ODS e Trabalhos

parent 326985eb
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateObjetivoDeDesenvolvimentoSustentavelsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('objetivo_de_desenvolvimento_sustentavels', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('nome');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('objetivo_de_desenvolvimento_sustentavels');
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateObjetivoDeDesenvolvimentoSustentavelTrabalhosTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('objetivo_de_desenvolvimento_sustentavel_trabalhos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('objetivo_de_desenvolvimento_sustentavel_id');
$table->foreign('objetivo_de_desenvolvimento_sustentavel_id')->references('id')->on('objetivo_de_desenvolvimento_sustentavels');
$table->integer('trabalho_id');
$table->foreign('trabalho_id')->references('id')->on('trabalhos');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ods_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