feat:E-Sign 템플릿 변수 시스템 추가 (마이그레이션+모델)

- field_variable, metadata, variables 컬럼 마이그레이션 추가
- EsignContract 모델에 metadata (JSON cast) 추가
- EsignSignField 모델에 field_variable 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
김보곤
2026-02-13 07:44:35 +09:00
parent ef23b9dda6
commit cd20f8d73f
3 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?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
{
// 템플릿에 변수 정의 JSON 추가
Schema::table('esign_field_templates', function (Blueprint $table) {
$table->json('variables')->nullable()->after('signer_count');
});
// 템플릿 필드에 변수 참조 추가
Schema::table('esign_field_template_items', function (Blueprint $table) {
$table->string('field_variable', 50)->nullable()->after('field_label');
});
// 계약에 메타데이터 JSON 추가
Schema::table('esign_contracts', function (Blueprint $table) {
$table->json('metadata')->nullable()->after('status');
});
// 계약 필드에 변수 참조 추가
Schema::table('esign_sign_fields', function (Blueprint $table) {
$table->string('field_variable', 50)->nullable()->after('field_label');
});
}
public function down(): void
{
Schema::table('esign_sign_fields', function (Blueprint $table) {
$table->dropColumn('field_variable');
});
Schema::table('esign_contracts', function (Blueprint $table) {
$table->dropColumn('metadata');
});
Schema::table('esign_field_template_items', function (Blueprint $table) {
$table->dropColumn('field_variable');
});
Schema::table('esign_field_templates', function (Blueprint $table) {
$table->dropColumn('variables');
});
}
};