From 182058758045f62633cb9e5d0c1e8e35e735afbc Mon Sep 17 00:00:00 2001 From: Beth Parker Date: Mon, 7 Feb 2022 18:43:41 -0600 Subject: [PATCH] changed quantity to float to allow for fractions and added recipe maintainer --- .../migrations/2022_02_08_001417_create_recipes_table.php | 4 +++- .../2022_02_08_003527_create_recipe_ingredient_table.php | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/database/migrations/2022_02_08_001417_create_recipes_table.php b/database/migrations/2022_02_08_001417_create_recipes_table.php index 07ca321..0289167 100644 --- a/database/migrations/2022_02_08_001417_create_recipes_table.php +++ b/database/migrations/2022_02_08_001417_create_recipes_table.php @@ -16,13 +16,15 @@ class CreateRecipesTable extends Migration Schema::create('recipes', function (Blueprint $table) { $table->id(); $table->string('name'); + $table->unsignedInteger('maintainer'); $table->string('author'); $table->unsignedInteger('servings'); $table->datetime('date_entered'); $table->datetime('date_modified'); $table->longtext('instructions'); - $table->timestamps(); + + $table->foreign('maintainer')->references('id')->on('users'); }); } diff --git a/database/migrations/2022_02_08_003527_create_recipe_ingredient_table.php b/database/migrations/2022_02_08_003527_create_recipe_ingredient_table.php index c499f4d..ba5dc31 100644 --- a/database/migrations/2022_02_08_003527_create_recipe_ingredient_table.php +++ b/database/migrations/2022_02_08_003527_create_recipe_ingredient_table.php @@ -18,7 +18,7 @@ class CreateRecipeIngredientTable extends Migration $table->unsignedInteger('recipe_id'); $table->unsignedInteger('ingredient_id'); $table->string('name'); - $table->unsignedInteger('quantity'); + $table->float('quantity'); $table->string('measurement'); $table->longText('special_notes'); $table->timestamps();