reordered migrations to run
This commit is contained in:
@@ -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'); }
|
||||
};
|
||||
Reference in New Issue
Block a user