31 lines
949 B
PHP
31 lines
949 B
PHP
<?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();
|
||
|
|
$table->string('name');
|
||
|
|
$table->text('summary')->nullable();
|
||
|
|
$table->string('cover_url')->nullable();
|
||
|
|
$table->string('slug')->nullable();
|
||
|
|
$table->json('genres')->nullable();
|
||
|
|
$table->json('platforms')->nullable();
|
||
|
|
$table->date('first_release_date')->nullable();
|
||
|
|
$table->float('rating')->nullable();
|
||
|
|
$table->integer('rating_count')->nullable();
|
||
|
|
$table->timestamps();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('games');
|
||
|
|
}
|
||
|
|
};
|