prepared and gallery fixes

This commit is contained in:
2026-02-19 08:36:32 +01:00
parent 8935065af1
commit c30fa5a392
36 changed files with 1437 additions and 104 deletions

View File

@@ -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
{
public function up(): void
{
Schema::table('forum_threads', function (Blueprint $table) {
// drop existing FK if present
try {
$table->dropForeign(['category_id']);
} catch (\Exception $e) {
// ignore if not exists
}
$table->foreign('category_id')->references('id')->on('forum_categories')->cascadeOnDelete();
});
}
public function down(): void
{
Schema::table('forum_threads', function (Blueprint $table) {
try {
$table->dropForeign(['category_id']);
} catch (\Exception $e) {
}
$table->foreign('category_id')->references('id')->on('categories')->cascadeOnDelete();
});
}
};