feat(events): support event cover attachments

This commit is contained in:
2026-09-18 14:33:21 -03:00
parent 22ef5619f3
commit 8d2250d247
5 changed files with 37 additions and 1 deletions

View File

@@ -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(): void
{
Schema::table('events', function (Blueprint $table): void {
$table->foreignId('attachment_id')->nullable()->constrained('attachments')->nullOnDelete();
});
}
public function down(): void
{
Schema::table('events', function (Blueprint $table): void {
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
$table->dropForeign(['attachment_id']);
}
$table->dropColumn('attachment_id');
});
}
};