diff --git a/database/migrations/2026_02_28_100000_add_block_builder_to_document_templates.php b/database/migrations/2026_02_28_100000_add_block_builder_to_document_templates.php new file mode 100644 index 0000000..d742fbc --- /dev/null +++ b/database/migrations/2026_02_28_100000_add_block_builder_to_document_templates.php @@ -0,0 +1,33 @@ +string('builder_type', 20)->default('legacy')->after('category') + ->comment('빌더 유형 (legacy: 기존 EAV, block: 블록 빌더)'); + $table->json('schema')->nullable()->after('footer_judgement_options') + ->comment('블록 빌더 JSON 스키마'); + $table->json('page_config')->nullable()->after('schema') + ->comment('페이지 설정 (용지 크기, 방향, 여백 등)'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('document_templates', function (Blueprint $table) { + $table->dropColumn(['builder_type', 'schema', 'page_config']); + }); + } +}; diff --git a/database/migrations/2026_02_28_100001_add_block_data_to_documents.php b/database/migrations/2026_02_28_100001_add_block_data_to_documents.php new file mode 100644 index 0000000..7d3668f --- /dev/null +++ b/database/migrations/2026_02_28_100001_add_block_data_to_documents.php @@ -0,0 +1,33 @@ +json('data')->nullable()->after('status') + ->comment('블록 빌더 문서 데이터 (JSON)'); + $table->longText('rendered_html')->nullable()->after('data') + ->comment('렌더링된 HTML (PDF 생성용 캐시)'); + $table->string('pdf_path', 500)->nullable()->after('rendered_html') + ->comment('생성된 PDF 파일 경로'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('documents', function (Blueprint $table) { + $table->dropColumn(['data', 'rendered_html', 'pdf_path']); + }); + } +};