feat: [document] 블록 빌더 지원 마이그레이션 추가
- document_templates: builder_type, schema, page_config 컬럼 추가 - documents: data JSON, rendered_html, pdf_path 컬럼 추가
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('document_templates', function (Blueprint $table) {
|
||||||
|
$table->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']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('documents', function (Blueprint $table) {
|
||||||
|
$table->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']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user