Change Food `serving_size` to `decimal` and refresh migrations

This commit is contained in:
Christopher C. Wells 2021-04-20 09:53:39 -07:00
parent 431de7f696
commit 6202ddf903
3 changed files with 2 additions and 34 deletions

View File

@ -19,7 +19,7 @@ class CreateFoodsTable extends Migration
$table->string('brand')->nullable();
$table->string('source')->nullable();
$table->string('notes')->nullable();
$table->unsignedFloat('serving_size');
$table->decimal('serving_size', 10, 8)->unsigned();
$table->enum('serving_unit', ['tsp', 'tbsp', 'cup', 'oz'])->nullable();
$table->string('serving_unit_name')->nullable();
$table->unsignedFloat('serving_weight');

View File

@ -24,7 +24,7 @@ class CreateRecipesTable extends Migration
$table->string('source')->nullable();
$table->unsignedInteger('servings');
$table->unsignedFloat('weight')->nullable();
//$table->decimal('volume', 10, 8)->unsigned()->nullable();
$table->decimal('volume', 10, 8)->unsigned()->nullable();
$table->timestamps();
});
}

View File

@ -1,32 +0,0 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AddVolumeToRecipes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('recipes', function (Blueprint $table) {
$table->decimal('volume', 10, 8)->unsigned()->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('recipes', function (Blueprint $table) {
$table->dropColumn('volume');
});
}
}