Additional event informations can be added

This commit is contained in:
2026-08-12 15:01:35 +02:00
parent 554166803b
commit 9581176a0c
28 changed files with 675 additions and 39 deletions
@@ -0,0 +1,23 @@
<?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) {
// Veranstaltungsspezifische Pflicht-Auswahlfragen (Teilnahmeoptionen), je Frage genau eine Option.
// Struktur: [ { key, label, options: [ { value, label } ] } ]
$table->json('participation_options')->nullable();
});
}
public function down(): void
{
Schema::table('events', function (Blueprint $table) {
$table->dropColumn('participation_options');
});
}
};
@@ -0,0 +1,35 @@
<?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
{
// Gewählte Teilnahmeoptionen je Anmeldung -- eine Zeile pro beantworteter Frage.
// Frage-/Options-Label werden als Snapshot mitgespeichert, damit spätere Änderungen der
// Fragen-Definition am Event bestehende Anmeldungen/Auswertungen nicht verfälschen.
Schema::create('event_participant_options', function (Blueprint $table) {
$table->id();
$table->string('tenant');
$table->foreignId('event_id')->constrained('events', 'id')->cascadeOnDelete()->cascadeOnUpdate();
$table->foreignId('event_participant_id')->constrained('event_participants', 'id')->cascadeOnDelete()->cascadeOnUpdate();
$table->string('question_key');
$table->string('question_label');
$table->string('value');
$table->string('value_label');
$table->timestamps();
$table->foreign('tenant')->references('slug')->on('tenants')->restrictOnDelete()->cascadeOnUpdate();
});
}
public function down(): void
{
Schema::dropIfExists('event_participant_options');
}
};