fixed events+tasks system migration

This commit is contained in:
Codex Agent
2025-11-15 21:18:39 +01:00
parent 9835906949
commit d2fa5f943e

View File

@@ -39,6 +39,22 @@ return new class extends Migration
}
}
// Task Collections
if (! Schema::hasTable('task_collections')) {
Schema::create('task_collections', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete();
$table->string('slug')->nullable()->unique();
$table->json('name_translations');
$table->json('description_translations')->nullable();
$table->foreignId('event_type_id')->nullable()->constrained()->nullOnDelete();
$table->boolean('is_default')->default(false);
$table->integer('position')->default(0);
$table->timestamps();
$table->index(['tenant_id', 'is_default', 'position']);
});
}
// Tasks table
if (! Schema::hasTable('tasks')) {
Schema::create('tasks', function (Blueprint $table) {
@@ -72,22 +88,6 @@ return new class extends Migration
}
}
// Task Collections
if (!Schema::hasTable('task_collections')) {
Schema::create('task_collections', function (Blueprint $table) {
$table->id();
$table->foreignId('tenant_id')->nullable()->constrained()->nullOnDelete();
$table->string('slug')->nullable()->unique();
$table->json('name_translations');
$table->json('description_translations')->nullable();
$table->foreignId('event_type_id')->nullable()->constrained()->nullOnDelete();
$table->boolean('is_default')->default(false);
$table->integer('position')->default(0);
$table->timestamps();
$table->index(['tenant_id', 'is_default', 'position']);
});
}
// Task Collection - Task Pivot
if (! Schema::hasTable('task_collection_task')) {
Schema::create('task_collection_task', function (Blueprint $table) {