lots of progress

This commit is contained in:
2025-04-12 17:18:33 +03:00
parent 8d230e8e67
commit 3d4260d57e
44 changed files with 2590 additions and 2883 deletions
@@ -0,0 +1,26 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('ratings', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->foreignId('game_id')->constrained()->onDelete('cascade');
$table->integer('rating');
$table->timestamps();
$table->unique(['user_id', 'game_id']);
});
}
public function down()
{
Schema::dropIfExists('ratings');
}
};
@@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('reviews', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->foreignId('game_id')->constrained()->onDelete('cascade');
$table->text('content');
$table->boolean('recommended');
$table->integer('rating')->unsigned()->between(1, 10);
$table->timestamps();
$table->unique(['user_id', 'game_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('reviews');
}
};
@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('game_lists', function (Blueprint $table) {
$table->id();
$table->foreignId('user_id')->constrained()->onDelete('cascade');
$table->string('name');
$table->string('slug')->unique();
$table->text('description')->nullable();
$table->boolean('is_default')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('game_lists');
}
};
@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('game_game_list', function (Blueprint $table) {
$table->id();
$table->foreignId('game_id')->constrained()->onDelete('cascade');
$table->foreignId('game_list_id')->constrained()->onDelete('cascade');
$table->timestamps();
$table->unique(['game_id', 'game_list_id']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('game_game_list');
}
};