Files
laraundfelix/database/migrations/2026_11_16_130000_identity_display_fields.php
T
LarsandCursor 5e763d15ec
Deploy Test / test (push) Successful in 17s
Deploy Test / deploy (push) Successful in 25s
Ergaenze Stammdaten, Suche, Dimensionen, Abdeckung und Ausgabenachweis
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-16 08:24:23 +01:00

46 lines
1.6 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::table('content_elements', function (Blueprint $table) {
$table->string('display_title')->nullable()->after('working_title');
$table->text('summary')->nullable()->after('description');
});
Schema::table('compositions', function (Blueprint $table) {
$table->string('display_title')->nullable()->after('designation');
$table->text('summary')->nullable()->after('display_title');
});
Schema::create('identity_changes', function (Blueprint $table) {
$table->id();
$table->string('subject_type');
$table->unsignedBigInteger('subject_id');
$table->string('field');
$table->text('before')->nullable();
$table->text('after')->nullable();
$table->foreignId('actor_id')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('occurred_at');
$table->timestamps();
$table->index(['subject_type', 'subject_id']);
});
}
public function down(): void
{
Schema::dropIfExists('identity_changes');
Schema::table('compositions', function (Blueprint $table) {
$table->dropColumn(['display_title', 'summary']);
});
Schema::table('content_elements', function (Blueprint $table) {
$table->dropColumn(['display_title', 'summary']);
});
}
};