mirror of https://github.com/kcal-app/kcal.git
Change Food `serving_size` to `decimal` and refresh migrations
This commit is contained in:
parent
431de7f696
commit
6202ddf903
|
@ -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');
|
||||
|
|
|
@ -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();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue