- 템플릿별 동적 필드 정의 (document_template_section_fields) - 외부 키 매핑 동적화 (document_template_links + link_values) - 문서 레벨 연결 (document_links) - 시스템 프리셋 (document_template_field_presets) - section_items에 field_values JSON 컬럼 추가 - 기존 고정 필드 → 동적 field_values 데이터 마이그레이션 - search_api → source_table 전환 마이그레이션 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
828 B
PHP
39 lines
828 B
PHP
<?php
|
|
|
|
namespace App\Models\Documents;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
/**
|
|
* 템플릿 레벨 연결 값 (기존 linked_item_ids/linked_process_id 대체)
|
|
*/
|
|
class DocumentTemplateLinkValue extends Model
|
|
{
|
|
protected $table = 'document_template_link_values';
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $fillable = [
|
|
'template_id',
|
|
'link_id',
|
|
'linkable_id',
|
|
'sort_order',
|
|
'created_at',
|
|
];
|
|
|
|
protected $casts = [
|
|
'sort_order' => 'integer',
|
|
];
|
|
|
|
public function template(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DocumentTemplate::class, 'template_id');
|
|
}
|
|
|
|
public function link(): BelongsTo
|
|
{
|
|
return $this->belongsTo(DocumentTemplateLink::class, 'link_id');
|
|
}
|
|
}
|