Recipes/database/migrations/2022_02_08_001417_create_recipes_table.php
2022-02-12 23:32:09 -06:00

42 lines
1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateRecipesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('recipes', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->unsignedInteger('user_id');
$table->string('author');
$table->unsignedInteger('servings');
$table->string('serving_size');
$table->datetime('date_entered');
$table->datetime('date_modified');
$table->longtext('description');
$table->longtext('instructions');
$table->timestamps();
$table->foreign('user_id')->references('id')->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('recipes');
}
}