ClearBowl/api/database/migrations/2019_12_15_124929_create_recipe_steps_table.php

38 lines
847 B
PHP
Raw Normal View History

2019-12-15 15:45:22 +01:00
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateRecipeStepsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('recipe_steps', function (Blueprint $table) {
$table->increments('id');
$table->integer('recipe_id')->unsigned();
$table->string('step');
$table->foreign('recipe_id')
->references('id')
->on('recipes')
->onUpdate('cascade')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('recipe_steps');
}
}