forked from eatvio/eatvio-infra
42 lines
1.3 KiB
PHP
42 lines
1.3 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('plans', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name')->comment('name of plan');
|
|
$table->string('image')->nullable()->comment('public path to image');
|
|
$table->smallInteger('duration')->comment('plan duration - 7, 14, 21 days');
|
|
$table->string('state')->comment('active/draft/archived');
|
|
$table->json('type')->comment('to lose weight, to gain weight, to improve your mood, to shape your eating behavior');
|
|
$table->text('details')->comment('plan details');
|
|
$table->tinyInteger('packets_count')->comment('1 on 3 packets of options in plan');
|
|
$table->json('packet1_options');
|
|
$table->json('packet2_options');
|
|
$table->json('packet3_options');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('plans');
|
|
}
|
|
};
|