Ergänze die gemeinsame redaktionelle Basis an den Fachobjekten.
Texte, Materialart und Präsentationsmedien bleiben am Medium, Modul, Programm und Lizenzartikel und werden von Verwaltung und Karten aus derselben Quelle gelesen, ohne Fassung oder Lizenz zu verändern. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
c4be6ed8dc
commit
f29ea58fd5
40 files changed
+2311
-20
No files matched your search
@@ -0,0 +1,191 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('content_elements', function (Blueprint $table) {
|
||||
$table->text('teaser')->nullable()->after('display_title');
|
||||
$table->text('search_terms')->nullable()->after('summary');
|
||||
});
|
||||
|
||||
Schema::table('compositions', function (Blueprint $table) {
|
||||
$table->text('teaser')->nullable()->after('display_title');
|
||||
$table->text('search_terms')->nullable()->after('description');
|
||||
});
|
||||
|
||||
Schema::table('license_articles', function (Blueprint $table) {
|
||||
$table->string('working_title')->nullable()->after('code');
|
||||
$table->string('display_title')->nullable()->after('working_title');
|
||||
$table->text('teaser')->nullable()->after('display_title');
|
||||
$table->text('summary')->nullable()->after('teaser');
|
||||
$table->text('description')->nullable()->after('summary');
|
||||
$table->text('search_terms')->nullable()->after('description');
|
||||
$table->foreignId('editorial_content_kind_id')
|
||||
->nullable()
|
||||
->after('search_terms')
|
||||
->constrained('editorial_content_kinds')
|
||||
->nullOnDelete();
|
||||
});
|
||||
|
||||
Schema::create('editorial_text_variants', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('subject_type');
|
||||
$table->unsignedBigInteger('subject_id');
|
||||
$table->string('field');
|
||||
$table->string('audience');
|
||||
$table->text('body');
|
||||
$table->timestamps();
|
||||
$table->unique(['subject_type', 'subject_id', 'field', 'audience'], 'editorial_text_variant_unique');
|
||||
});
|
||||
|
||||
Schema::create('presentation_roles', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('slug')->unique();
|
||||
$table->string('label');
|
||||
$table->boolean('multiple')->default(false);
|
||||
$table->boolean('ordered')->default(false);
|
||||
$table->unsignedInteger('sort_order')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('presentation_assignments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('subject_type');
|
||||
$table->unsignedBigInteger('subject_id');
|
||||
$table->foreignId('content_element_id')->constrained('content_elements')->cascadeOnDelete();
|
||||
$table->foreignId('presentation_role_id')->constrained('presentation_roles')->cascadeOnDelete();
|
||||
$table->unsignedInteger('position')->default(1);
|
||||
$table->foreignId('source_version_id')->nullable()->constrained('content_element_versions')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
$table->unique(
|
||||
['subject_type', 'subject_id', 'presentation_role_id', 'content_element_id'],
|
||||
'presentation_assignment_unique',
|
||||
);
|
||||
$table->index(['subject_type', 'subject_id'], 'presentation_assignment_subject');
|
||||
});
|
||||
|
||||
$now = now();
|
||||
|
||||
foreach ([
|
||||
['slug' => 'unterrichtsfilm', 'label' => 'Unterrichtsfilm', 'sort_order' => 50],
|
||||
['slug' => 'kurzfilm', 'label' => 'Kurzfilm / Filmbeispiel', 'sort_order' => 60],
|
||||
['slug' => 'trailer', 'label' => 'Trailer / Teaserfilm', 'sort_order' => 70],
|
||||
['slug' => 'interview', 'label' => 'Interview', 'sort_order' => 80],
|
||||
['slug' => 'arbeitsblatt', 'label' => 'Arbeitsblatt', 'sort_order' => 90],
|
||||
['slug' => 'uebungsbeschreibung', 'label' => 'Übungsbeschreibung', 'sort_order' => 100],
|
||||
['slug' => 'titelbild', 'label' => 'Titelbild / Keyvisual', 'sort_order' => 110],
|
||||
['slug' => 'hintergrundbild', 'label' => 'Hintergrundbild', 'sort_order' => 120],
|
||||
['slug' => 'praesentationsbild', 'label' => 'Sonstiges Präsentationsbild', 'sort_order' => 130],
|
||||
['slug' => 'audioanleitung', 'label' => 'Audioanleitung', 'sort_order' => 140],
|
||||
] as $row) {
|
||||
DB::table('editorial_content_kinds')->insert($row + ['created_at' => $now, 'updated_at' => $now]);
|
||||
}
|
||||
|
||||
$dimensions = [
|
||||
'verwendungszweck' => [
|
||||
'label' => 'Redaktioneller Verwendungszweck',
|
||||
'values' => [
|
||||
'training' => 'Training / Lehrinhalt',
|
||||
'begleitmaterial' => 'Trainer- und Begleitmaterial',
|
||||
'website' => 'Website / Marketing',
|
||||
'marke' => 'Markenpräsentation',
|
||||
'intern' => 'Interne redaktionelle Ressource',
|
||||
],
|
||||
],
|
||||
'zielgruppe' => [
|
||||
'label' => 'Altersbereich und Zielgruppe',
|
||||
'values' => [
|
||||
'kinder' => 'Kinder',
|
||||
'jugendliche' => 'Jugendliche',
|
||||
'erwachsene' => 'Erwachsene',
|
||||
'eltern' => 'Eltern',
|
||||
'fachkraefte' => 'Fachkräfte',
|
||||
],
|
||||
],
|
||||
'einsatzbereich' => [
|
||||
'label' => 'Einsatzbereich',
|
||||
'values' => [
|
||||
'kita' => 'Kita',
|
||||
'schule' => 'Schule',
|
||||
'familie' => 'Familie',
|
||||
'fortbildung' => 'Fortbildung',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($dimensions as $slug => $dimension) {
|
||||
$dimensionId = DB::table('editorial_dimensions')->insertGetId([
|
||||
'slug' => $slug,
|
||||
'label' => $dimension['label'],
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
|
||||
foreach ($dimension['values'] as $valueSlug => $label) {
|
||||
DB::table('editorial_dimension_values')->insert([
|
||||
'editorial_dimension_id' => $dimensionId,
|
||||
'slug' => $valueSlug,
|
||||
'label' => $label,
|
||||
'created_at' => $now,
|
||||
'updated_at' => $now,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
foreach ([
|
||||
['slug' => 'titelbild', 'label' => 'Titelbild / Standard-Thumbnail', 'multiple' => false, 'ordered' => false, 'sort_order' => 10],
|
||||
['slug' => 'titelbild_alternativ', 'label' => 'Alternatives Titelbild', 'multiple' => true, 'ordered' => true, 'sort_order' => 20],
|
||||
['slug' => 'hero', 'label' => 'Hero-Bild', 'multiple' => false, 'ordered' => false, 'sort_order' => 30],
|
||||
['slug' => 'hover', 'label' => 'Hoverbild', 'multiple' => false, 'ordered' => false, 'sort_order' => 40],
|
||||
['slug' => 'trailer', 'label' => 'Trailer / Teaserfilm', 'multiple' => true, 'ordered' => true, 'sort_order' => 50],
|
||||
['slug' => 'vorschauclip', 'label' => 'Vorschauclip', 'multiple' => true, 'ordered' => true, 'sort_order' => 60],
|
||||
['slug' => 'audiovorschau', 'label' => 'Audiovorschau', 'multiple' => true, 'ordered' => true, 'sort_order' => 70],
|
||||
['slug' => 'interview', 'label' => 'Interview', 'multiple' => true, 'ordered' => true, 'sort_order' => 80],
|
||||
['slug' => 'galerie', 'label' => 'Galerieelement', 'multiple' => true, 'ordered' => true, 'sort_order' => 90],
|
||||
] as $role) {
|
||||
DB::table('presentation_roles')->insert($role + ['created_at' => $now, 'updated_at' => $now]);
|
||||
}
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('presentation_assignments');
|
||||
Schema::dropIfExists('presentation_roles');
|
||||
Schema::dropIfExists('editorial_text_variants');
|
||||
|
||||
Schema::table('license_articles', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('editorial_content_kind_id');
|
||||
$table->dropColumn(['working_title', 'display_title', 'teaser', 'summary', 'description', 'search_terms']);
|
||||
});
|
||||
|
||||
Schema::table('compositions', function (Blueprint $table) {
|
||||
$table->dropColumn(['teaser', 'search_terms']);
|
||||
});
|
||||
|
||||
Schema::table('content_elements', function (Blueprint $table) {
|
||||
$table->dropColumn(['teaser', 'search_terms']);
|
||||
});
|
||||
|
||||
$dimensionIds = DB::table('editorial_dimensions')
|
||||
->whereIn('slug', ['verwendungszweck', 'zielgruppe', 'einsatzbereich'])
|
||||
->pluck('id');
|
||||
|
||||
DB::table('identity_dimension_values')->whereIn(
|
||||
'editorial_dimension_value_id',
|
||||
DB::table('editorial_dimension_values')->whereIn('editorial_dimension_id', $dimensionIds)->pluck('id'),
|
||||
)->delete();
|
||||
DB::table('editorial_dimension_values')->whereIn('editorial_dimension_id', $dimensionIds)->delete();
|
||||
DB::table('editorial_dimensions')->whereIn('id', $dimensionIds)->delete();
|
||||
|
||||
DB::table('editorial_content_kinds')->whereIn('slug', [
|
||||
'unterrichtsfilm', 'kurzfilm', 'trailer', 'interview', 'arbeitsblatt', 'uebungsbeschreibung',
|
||||
'titelbild', 'hintergrundbild', 'praesentationsbild', 'audioanleitung',
|
||||
])->delete();
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user