27 lines
776 B
PHP
27 lines
776 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('screenshots', function (Blueprint $table) {
|
||
|
|
$table->id();
|
||
|
|
$table->unsignedBigInteger('igdb_id')->unique();
|
||
|
|
$table->foreignId('game_id')->constrained()->onDelete('cascade');
|
||
|
|
$table->string('url');
|
||
|
|
$table->integer('width')->nullable();
|
||
|
|
$table->integer('height')->nullable();
|
||
|
|
$table->string('image_id')->nullable();
|
||
|
|
$table->timestamps();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('screenshots');
|
||
|
|
}
|
||
|
|
};
|