ldc-ovoteam/database/migrations/2026_07_02_114954_create_recipes.php

48 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration
{
public function up(): void
{
Schema::create('recipes', function (Blueprint $table) {
$table->uuid('id')->primary();
// SEO & Medias
$table->string('seo_title');
$table->string('seo_description');
$table->string('picture');
$table->string('picture_alt');
$table->string('picture_title');
$table->string('name');
$table->string('slug')->unique();
$table->string('product_category')->comment('Domain\Models\ValueObjects\Products\ProductRange');
$table->string('consomption_time')->comment('Domain\Models\ValueObjects\Recipes\ConsumptionTime');
$table->string('inspiration')->comment('Domain\Models\ValueObjects\Recipes\Inspiration');
$table->string('season')->comment('Domain\Models\ValueObjects\Recipes\Season');
$table->text('description')->nullable();
$table->text('details')->nullable();
$table->text('ingredients_list');
$table->text('preparation_steps');
$table->text('tips_and_advices')->nullable();
$table->softDeletes();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('recipes');
}
};