Files
cleargame/database/migrations/2024_02_19_000003_create_screenshots_table.php
T
2025-04-09 23:03:16 +03:00

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');
}
};