Profile: store covers in object storage (WebP); add covers config; remember artworks categories content-type preference

This commit is contained in:
2026-03-29 09:22:36 +02:00
parent cab4fbd83e
commit 1da7d3bf88
27 changed files with 703 additions and 448 deletions

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::table('content_types', function (Blueprint $table): void {
$table->unsignedInteger('order')->default(0)->after('description');
$table->index('order');
});
$ids = DB::table('content_types')
->orderBy('id')
->pluck('id');
foreach ($ids as $index => $id) {
DB::table('content_types')
->where('id', $id)
->update(['order' => $index + 1]);
}
}
public function down(): void
{
Schema::table('content_types', function (Blueprint $table): void {
$table->dropIndex(['order']);
$table->dropColumn('order');
});
}
};