diff --git a/backend/src/models/document_link.py b/backend/src/models/document_link.py index 22ca35d..b5c3145 100644 --- a/backend/src/models/document_link.py +++ b/backend/src/models/document_link.py @@ -19,8 +19,8 @@ class DocumentLink(Base): # 링크가 생성된 문서 (출발점) source_document_id = Column(UUID(as_uuid=True), ForeignKey('documents.id'), nullable=False, index=True) - # 링크 대상 문서 (도착점) - target_document_id = Column(UUID(as_uuid=True), ForeignKey('documents.id'), nullable=False, index=True) + # 링크 대상 문서 또는 노트 (도착점) - 외래키 제약 조건 제거하여 노트 ID도 허용 + target_document_id = Column(UUID(as_uuid=True), nullable=False, index=True) # 출발점 텍스트 정보 (기존) selected_text = Column(Text, nullable=False) # 선택된 텍스트