fixed events+tasks system migration
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user