reordered migrations to run

This commit is contained in:
Doar Mihai
2026-05-30 01:19:16 +03:00
parent 5813bc779a
commit 58e587f955
10 changed files with 201 additions and 6 deletions
@@ -0,0 +1,21 @@
<?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('reviews', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
$table->foreignId('game_id')->constrained()->cascadeOnDelete();
$table->unsignedTinyInteger('rating')->nullable(); // 1-10
$table->text('body');
$table->boolean('has_spoilers')->default(false);
$table->unsignedInteger('helpful_count')->default(0);
$table->timestamps();
$table->unique(['user_id', 'game_id']);
$table->index(['game_id', 'helpful_count']);
});
}
public function down(): void { Schema::dropIfExists('reviews'); }
};