Files
eatvio-infra/database/migrations/2022_08_26_094740_create_diets_table.php
2023-12-29 10:58:52 +03:00

39 lines
1.1 KiB
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('diets', function (Blueprint $table) {
$table->id();
$table->string('name')->comment('name of diet');
$table->string('image')->nullable()->comment('public path to image');
$table->smallInteger('duration')->comment('diet duration - 7, 14, 28 days');
$table->string('state')->comment('active/draft/archived');
$table->json('type')->comment('has meat/vegs/carb/alcohol');
$table->text('details')->comment('diet details');
$table->json('daily_schedule')->comment('A list of planned foods');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('diets');
}
};