id(); $table->string('name'); $table->string('kind')->default('dokument'); $table->boolean('show_cover')->default(true); $table->foreignId('header_version_id')->nullable()->constrained('content_element_versions')->nullOnDelete(); $table->foreignId('footer_version_id')->nullable()->constrained('content_element_versions')->nullOnDelete(); $table->foreignId('cover_version_id')->nullable()->constrained('content_element_versions')->nullOnDelete(); $table->string('publisher')->nullable(); $table->text('copyright')->nullable(); $table->timestamps(); }); Schema::table('compositions', function (Blueprint $table) { $table->foreignId('pdf_template_id')->nullable()->constrained('pdf_templates')->nullOnDelete(); }); Schema::table('composition_versions', function (Blueprint $table) { $table->json('document_meta')->nullable(); }); } public function down(): void { Schema::table('composition_versions', function (Blueprint $table) { $table->dropColumn('document_meta'); }); Schema::table('compositions', function (Blueprint $table) { $table->dropConstrainedForeignId('pdf_template_id'); }); Schema::dropIfExists('pdf_templates'); } };