🐛 Fix: 백엔드 500 오류 해결 및 배포용 도커 설정 완성
- Dockerfile: Poetry 대신 직접 pip 설치로 의존성 문제 해결 - highlights.py: UUID 임포트 추가, 들여쓰기 오류 수정, 1:N 관계 지원 - notes.py: Pydantic v2 호환성 수정, 다중 메모 지원 - models: highlight-note 관계를 1:1에서 1:N으로 변경 - docker-compose.yml: 배포용 환경변수 설정 ✅ 로그인 API 정상 작동 확인 ✅ 나스/맥미니 배포 준비 완료
This commit is contained in:
@@ -41,7 +41,7 @@ class Highlight(Base):
|
||||
# 관계
|
||||
user = relationship("User", backref="highlights")
|
||||
document = relationship("Document", back_populates="highlights")
|
||||
note = relationship("Note", back_populates="highlight", uselist=False, cascade="all, delete-orphan")
|
||||
notes = relationship("Note", back_populates="highlight", cascade="all, delete-orphan")
|
||||
|
||||
def __repr__(self):
|
||||
return f"<Highlight(id='{self.id}', text='{self.selected_text[:50]}...')>"
|
||||
|
||||
@@ -11,13 +11,13 @@ from ..core.database import Base
|
||||
|
||||
|
||||
class Note(Base):
|
||||
"""메모 테이블 (하이라이트와 1:1 관계)"""
|
||||
"""메모 테이블 (하이라이트와 1:N 관계)"""
|
||||
__tablename__ = "notes"
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
|
||||
# 연결 정보
|
||||
highlight_id = Column(UUID(as_uuid=True), ForeignKey("highlights.id"), nullable=False, unique=True)
|
||||
highlight_id = Column(UUID(as_uuid=True), ForeignKey("highlights.id"), nullable=False)
|
||||
|
||||
# 메모 내용
|
||||
content = Column(Text, nullable=False)
|
||||
@@ -31,7 +31,7 @@ class Note(Base):
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
# 관계
|
||||
highlight = relationship("Highlight", back_populates="note")
|
||||
highlight = relationship("Highlight", back_populates="notes")
|
||||
|
||||
@property
|
||||
def user_id(self):
|
||||
|
||||
Reference in New Issue
Block a user