From 8f776a5281f78cd67bb29988e4fa7904fc5fc412 Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Wed, 3 Sep 2025 19:02:15 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20DocumentLink=20=EB=AA=A8=EB=8D=B8?= =?UTF-8?q?=EC=97=90=EC=84=9C=20target=5Fdocument=20relationship=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 외래키 제약 조건 제거로 인한 SQLAlchemy relationship 오류 해결 - target_document relationship 제거 (노트 ID 지원을 위해) --- 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 b5c3145..f9c8f75 100644 --- a/backend/src/models/document_link.py +++ b/backend/src/models/document_link.py @@ -44,9 +44,9 @@ class DocumentLink(Base): created_at = Column(DateTime(timezone=True), server_default=func.now()) updated_at = Column(DateTime(timezone=True), onupdate=func.now()) - # 관계 + # 관계 - target_document는 외래키 제약 조건이 없으므로 relationship 제거 source_document = relationship("Document", foreign_keys=[source_document_id], backref="outgoing_links") - target_document = relationship("Document", foreign_keys=[target_document_id], backref="incoming_links") + # target_document relationship 제거 (노트 ID도 포함할 수 있으므로) creator = relationship("User", backref="created_links") def __repr__(self):