feat: increase gallery grid from 4 to 5 columns per row on desktopfeat: increase gallery grid from 4 to 5 columns per row on desktop

This commit is contained in:
2026-02-25 19:11:23 +01:00
parent 5c97488e80
commit 0032aec02f
131 changed files with 15674 additions and 597 deletions

View File

@@ -0,0 +1,37 @@
<?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('artwork_awards', function (Blueprint $table) {
$table->id();
$table->unsignedBigInteger('artwork_id');
$table->unsignedBigInteger('user_id');
$table->enum('medal', ['gold', 'silver', 'bronze']);
$table->tinyInteger('weight')->unsigned()->default(1);
$table->timestamps();
$table->unique(['artwork_id', 'user_id']);
$table->index('artwork_id');
$table->index('user_id');
$table->foreign('artwork_id')
->references('id')->on('artworks')
->cascadeOnDelete();
$table->foreign('user_id')
->references('id')->on('users')
->cascadeOnDelete();
});
}
public function down(): void
{
Schema::dropIfExists('artwork_awards');
}
};

View File

@@ -0,0 +1,33 @@
<?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('user_followers', function (Blueprint $table) {
$table->bigIncrements('id');
// The user being followed
$table->unsignedBigInteger('user_id');
// The follower
$table->unsignedBigInteger('follower_id');
$table->timestamp('created_at')->useCurrent();
$table->unique(['user_id', 'follower_id'], 'uq_user_follower');
$table->index('user_id', 'idx_uf_user');
$table->index('follower_id', 'idx_uf_follower');
$table->foreign('user_id')->references('id')->on('users')->cascadeOnDelete();
$table->foreign('follower_id')->references('id')->on('users')->cascadeOnDelete();
});
}
public function down(): void
{
Schema::dropIfExists('user_followers');
}
};

View File

@@ -0,0 +1,29 @@
<?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('artwork_award_stats', function (Blueprint $table) {
$table->unsignedBigInteger('artwork_id')->primary();
$table->unsignedInteger('gold_count')->default(0);
$table->unsignedInteger('silver_count')->default(0);
$table->unsignedInteger('bronze_count')->default(0);
$table->unsignedInteger('score_total')->default(0);
$table->timestamp('updated_at')->nullable();
$table->foreign('artwork_id')
->references('id')->on('artworks')
->cascadeOnDelete();
});
}
public function down(): void
{
Schema::dropIfExists('artwork_award_stats');
}
};

View File

@@ -0,0 +1,36 @@
<?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('profile_comments', function (Blueprint $table) {
$table->bigIncrements('id');
// Profile owner (who received the comment)
$table->unsignedBigInteger('profile_user_id');
// Who wrote the comment
$table->unsignedBigInteger('author_user_id');
$table->text('body');
$table->boolean('is_active')->default(true);
$table->timestamps();
$table->index('profile_user_id', 'idx_pc_profile');
$table->index('author_user_id', 'idx_pc_author');
$table->index(['profile_user_id', 'is_active', 'created_at'], 'idx_pc_active_feed');
$table->foreign('profile_user_id')->references('id')->on('users')->cascadeOnDelete();
$table->foreign('author_user_id')->references('id')->on('users')->cascadeOnDelete();
});
}
public function down(): void
{
Schema::dropIfExists('profile_comments');
}
};

View File

@@ -0,0 +1,25 @@
<?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::table('artwork_comments', function (Blueprint $table) {
// Tracks the original legacy comment_id for idempotent imports.
// NULL for comments created natively in the new system.
$table->unsignedInteger('legacy_id')->nullable()->unique()->after('id');
});
}
public function down(): void
{
Schema::table('artwork_comments', function (Blueprint $table) {
$table->dropUnique(['legacy_id']);
$table->dropColumn('legacy_id');
});
}
};

View File

@@ -0,0 +1,25 @@
<?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::table('user_statistics', function (Blueprint $table) {
if (! Schema::hasColumn('user_statistics', 'profile_views')) {
$table->unsignedInteger('profile_views')->default(0)->after('awards');
}
});
}
public function down(): void
{
Schema::table('user_statistics', function (Blueprint $table) {
if (Schema::hasColumn('user_statistics', 'profile_views')) {
$table->dropColumn('profile_views');
}
});
}
};