feat: schema v1.7 + sections/shifts frontend
- Universeel festival/event model (parent_event_id, event_type) - event_person_activations pivot tabel - Event model: parent/children relaties + helper scopes - DevSeeder: festival structuur met sub-events - Sections & Shifts frontend (twee-kolom layout) - BACKLOG.md aangemaakt met 22 gedocumenteerde wensen
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
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) {
|
||||
$table->foreignUlid('parent_event_id')
|
||||
->nullable()
|
||||
->after('organisation_id')
|
||||
->constrained('events')
|
||||
->nullOnDelete();
|
||||
|
||||
$table->enum('event_type', ['event', 'festival', 'series'])
|
||||
->default('event')
|
||||
->after('status');
|
||||
|
||||
$table->string('event_type_label')
|
||||
->nullable()
|
||||
->after('event_type');
|
||||
|
||||
$table->string('sub_event_label')
|
||||
->nullable()
|
||||
->after('event_type_label');
|
||||
|
||||
$table->boolean('is_recurring')
|
||||
->default(false)
|
||||
->after('sub_event_label');
|
||||
|
||||
$table->string('recurrence_rule')
|
||||
->nullable()
|
||||
->after('is_recurring');
|
||||
|
||||
$table->json('recurrence_exceptions')
|
||||
->nullable()
|
||||
->after('recurrence_rule');
|
||||
|
||||
$table->index('parent_event_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropForeign(['parent_event_id']);
|
||||
$table->dropIndex(['parent_event_id']);
|
||||
$table->dropColumn([
|
||||
'parent_event_id',
|
||||
'event_type',
|
||||
'event_type_label',
|
||||
'sub_event_label',
|
||||
'is_recurring',
|
||||
'recurrence_rule',
|
||||
'recurrence_exceptions',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
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('event_person_activations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignUlid('event_id')->constrained('events')->cascadeOnDelete();
|
||||
$table->foreignUlid('person_id')->constrained('persons')->cascadeOnDelete();
|
||||
|
||||
$table->unique(['event_id', 'person_id']);
|
||||
$table->index('person_id');
|
||||
$table->index('event_id');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_person_activations');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user