RSM-3 Update vacancy schema with team assoc

This commit is contained in:
Miguel Nogueira 2020-09-10 19:24:55 +01:00
parent b68449d3bf
commit dbeddd6fdb
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddTeamAssocToVacancies extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('vacancies', function (Blueprint $table) {
$table->bigInteger('ownerTeamID')->unsigned()->after('vacancyFormID');
$table->foreign('ownerTeamID')
->references('team_id')
->on('teams')
->onDelete('cascade')
->onUpdate('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('vacancies', function (Blueprint $table) {
//
});
}
}