Initial GameLog setup
- Laravel 11 + Breeze (dark mode) + Tailwind + Alpine.js - Migrations: games, genres, platforms, companies, pivots, user_games, user_lists, reviews, follows, activities - Models: Game, Genre, Platform, Company, UserGame, UserList, Review, ReviewVote, Activity, User (with gamelog fields) - IgdbService: OAuth2 token management, search, game fetch, popular/new releases, genre filter, cover/screenshot URL helpers - IGDB credentials in config/services.php (from .env)
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?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('games', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('igdb_id')->unique()->nullable();
|
||||
$table->string('slug')->unique();
|
||||
$table->string('title');
|
||||
$table->text('summary')->nullable();
|
||||
$table->string('cover_url')->nullable();
|
||||
$table->string('cover_thumb_url')->nullable();
|
||||
$table->date('release_date')->nullable();
|
||||
$table->string('release_year', 4)->nullable()->index();
|
||||
$table->decimal('rating_avg', 4, 2)->nullable()->default(null);
|
||||
$table->unsignedInteger('rating_count')->default(0);
|
||||
$table->unsignedInteger('review_count')->default(0);
|
||||
$table->unsignedInteger('library_count')->default(0);
|
||||
$table->string('status')->default('published'); // published|pending|hidden
|
||||
$table->timestamps();
|
||||
$table->index(['rating_avg', 'rating_count']);
|
||||
$table->index('release_year');
|
||||
});
|
||||
}
|
||||
public function down(): void { Schema::dropIfExists('games'); }
|
||||
};
|
||||
Reference in New Issue
Block a user