Creation and editing of events
This commit is contained in:
@@ -18,7 +18,8 @@ return new class extends Migration
|
||||
});
|
||||
|
||||
Schema::create('eating_habits', function (Blueprint $table) {
|
||||
$table->string('slug')->unique()->primary();
|
||||
$table->id();
|
||||
$table->string('slug')->unique();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
@@ -25,6 +25,7 @@ return new class extends Migration {
|
||||
$table->boolean('mail_on_new')->default(true);
|
||||
$table->boolean('allow_new')->default(true);
|
||||
$table->boolean('archived')->default(false);
|
||||
|
||||
$table->foreign('tenant')->references('slug')->on('tenants')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->foreign('type')->references('slug')->on('cost_unit_types')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->timestamps();
|
||||
|
||||
102
database/migrations/2026_02_14_140010_create_events.php
Normal file
102
database/migrations/2026_02_14_140010_create_events.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?php
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('participation_fee_types', function (Blueprint $table) {
|
||||
$table->string('slug')->primary();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('participation_types', function (Blueprint $table) {
|
||||
$table->string('slug')->primary();
|
||||
$table->string('name');
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('event_participation_fees', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('tenant');
|
||||
$table->string('type');
|
||||
$table->string('name');
|
||||
$table->string('description')->default('');
|
||||
$table->float('amount',2);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('type')->references('slug')->on('participation_types')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->foreign('tenant')->references('slug')->on('tenants')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
});
|
||||
|
||||
Schema::create('events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('tenant');
|
||||
$table->foreignId('cost_unit_id')->nullable()->constrained('cost_units', 'id')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
|
||||
$table->string('name');
|
||||
$table->string('location');
|
||||
$table->string('postal_code');
|
||||
$table->string('email');
|
||||
$table->dateTime('start_date');
|
||||
$table->dateTime('end_date');
|
||||
$table->dateTime('early_bird_end');
|
||||
$table->dateTime('registration_final_end');
|
||||
$table->integer('early_bird_end_amount_increase');
|
||||
$table->string('account_owner');
|
||||
$table->string('account_iban');
|
||||
$table->boolean('registration_allowed')->default(false);
|
||||
$table->string('participation_fee_type');
|
||||
$table->float('total_max_amount', 2)->default(0);
|
||||
$table->string('registration_link')->nullable();
|
||||
$table->boolean('pay_per_day');
|
||||
$table->boolean('pay_direct');
|
||||
$table->boolean('send_weekly_report')->default(true);
|
||||
$table->foreignId('participation_fee_1')->nullable()->constrained('event_participation_fees', 'id')->nullOnDelete()->cascadeOnUpdate();
|
||||
$table->foreignId('participation_fee_2')->nullable()->constrained('event_participation_fees', 'id')->nullOnDelete()->cascadeOnUpdate();
|
||||
$table->foreignId('participation_fee_3')->nullable()->constrained('event_participation_fees', 'id')->nullOnDelete()->cascadeOnUpdate();
|
||||
$table->foreignId('participation_fee_4')->nullable()->constrained('event_participation_fees', 'id')->nullOnDelete()->cascadeOnUpdate();
|
||||
$table->float('support_per_person', 2)->default(0);
|
||||
$table->float('support_flat', 2)->default(0);
|
||||
$table->integer('alcoholics_age')->default(16);
|
||||
$table->boolean('archived')->default(false);
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('tenant')->references('slug')->on('tenants')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->foreign('participation_fee_type')->references('slug')->on('participation_fee_types')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
});
|
||||
|
||||
Schema::create('event_allowed_eating_habits', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained('events', 'id')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->foreignId('eating_habit_id')->constrained('eating_habits', 'id')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('event_managers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained('events', 'id')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->string('user_id')->constrained('users', 'id')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cron_tasks');
|
||||
Schema::dropIfExists('cron_task_types');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('event_local_groups', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained('events', 'id')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->foreignId('local_group_id')->constrained('tenants', 'id')->cascadeOnDelete()->cascadeOnUpdate();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_local_groups');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user