From 6c19af373113d13e5ca1105b541b0d7f9624b6ef Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Wed, 3 Sep 2025 19:00:14 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EB=AC=B8=EC=84=9C-=EB=85=B8=ED=8A=B8=20?= =?UTF-8?q?=EA=B0=84=20=EB=A7=81=ED=81=AC=20=EC=A7=80=EC=9B=90=EC=9D=84=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20=EC=99=B8=EB=9E=98=ED=82=A4=20=EC=A0=9C?= =?UTF-8?q?=EC=95=BD=20=EC=A1=B0=EA=B1=B4=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - DocumentLink 모델에서 target_document_id 외래키 제약 조건 제거 - 노트 ID도 target_document_id에 저장할 수 있도록 수정 - 데이터베이스에서 fk_document_links_target_document_id_documents 제약 조건 제거 --- backend/src/models/document_link.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) # 선택된 텍스트