My beer compendium
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
944 B

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddForeignKeysToBeerAdjunctsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('beer_adjuncts', function (Blueprint $table) {
$table->foreign('beer_id', 'beer_id')->references('beer_id')->on('beer_summary')->onUpdate('RESTRICT')->onDelete('RESTRICT');
$table->foreign('adjunct_id', 'adjunct_id')->references('id')->on('adjuncts')->onUpdate('RESTRICT')->onDelete('RESTRICT');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('beer_adjuncts', function (Blueprint $table) {
$table->dropForeign('beer_id');
$table->dropForeign('adjunct_id');
});
}
}