38 lines
1.3 KiB
PHP
38 lines
1.3 KiB
PHP
<?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::create('events', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('tenant_id')->constrained()->onDelete('cascade');
|
|
$table->json('name');
|
|
$table->json('description')->nullable();
|
|
$table->dateTime('date');
|
|
$table->string('slug')->unique();
|
|
$table->string('location')->nullable();
|
|
$table->integer('max_participants')->nullable();
|
|
$table->json('settings')->nullable();
|
|
$table->unsignedBigInteger('event_type_id');
|
|
$table->boolean('is_active')->default(true);
|
|
$table->boolean('join_link_enabled')->default(true);
|
|
$table->boolean('photo_upload_enabled')->default(true);
|
|
$table->boolean('task_checklist_enabled')->default(true);
|
|
$table->string('default_locale', 5)->default('de');
|
|
$table->timestamps();
|
|
|
|
$table->index(['tenant_id', 'date', 'is_active']);
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('events');
|
|
}
|
|
};
|
|
|