feat: reviews

This commit is contained in:
2026-05-18 21:46:54 +02:00
parent bb409610a8
commit 67d838fa65
8 changed files with 358 additions and 2 deletions
@@ -0,0 +1,27 @@
<?php
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('post_reviews', function (Blueprint $table) {
$table->ulid('id')->primary();
$table->foreignUlid('meal_post_id')->constrained('meal_posts')->cascadeOnDelete();
$table->unsignedTinyInteger('rating');
$table->text('comment')->nullable();
$table->foreignUlid('user_id')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->unique(['meal_post_id', 'user_id']);
});
}
public function down(): void
{
Schema::dropIfExists('post_reviews');
}
};