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):