forked from eatvio/eatvio-infra
39 lines
1.1 KiB
PHP
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');
|
|
}
|
|
};
|