Fix: DocumentLink 모델에서 target_document relationship 제거

- 외래키 제약 조건 제거로 인한 SQLAlchemy relationship 오류 해결
- target_document relationship 제거 (노트 ID 지원을 위해)
This commit is contained in:
Hyungi Ahn
2025-09-03 19:02:15 +09:00
parent 6c19af3731
commit 8f776a5281

View File

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