zu fabricjs gewechselt, noch nicht funktionsfähig

This commit is contained in:
Codex Agent
2025-10-31 20:19:09 +01:00
parent 06df61f706
commit eb0c31c90b
33 changed files with 7718 additions and 2062 deletions

View File

@@ -0,0 +1,65 @@
<?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
{
if (Schema::hasTable('task_collections') && ! Schema::hasColumn('task_collections', 'source_collection_id')) {
Schema::table('task_collections', function (Blueprint $table) {
$table->foreignId('source_collection_id')
->nullable()
->after('event_type_id')
->constrained('task_collections')
->nullOnDelete();
});
}
if (Schema::hasTable('tasks')) {
Schema::table('tasks', function (Blueprint $table) {
if (! Schema::hasColumn('tasks', 'source_collection_id')) {
$table->foreignId('source_collection_id')
->nullable()
->after('collection_id')
->constrained('task_collections')
->nullOnDelete();
}
if (! Schema::hasColumn('tasks', 'source_task_id')) {
$table->foreignId('source_task_id')
->nullable()
->after('tenant_id')
->constrained('tasks')
->nullOnDelete();
}
});
}
}
public function down(): void
{
if (Schema::hasTable('tasks')) {
Schema::table('tasks', function (Blueprint $table) {
if (Schema::hasColumn('tasks', 'source_collection_id')) {
$table->dropForeign(['source_collection_id']);
$table->dropColumn('source_collection_id');
}
if (Schema::hasColumn('tasks', 'source_task_id')) {
$table->dropForeign(['source_task_id']);
$table->dropColumn('source_task_id');
}
});
}
if (Schema::hasTable('task_collections') && Schema::hasColumn('task_collections', 'source_collection_id')) {
Schema::table('task_collections', function (Blueprint $table) {
$table->dropForeign(['source_collection_id']);
$table->dropColumn('source_collection_id');
});
}
}
};