diff --git a/models/book.py b/models/book.py index f790588..5163d00 100644 --- a/models/book.py +++ b/models/book.py @@ -14,7 +14,9 @@ class Book(Base): publication_year = Column(Integer) author_id = Column(String, ForeignKey("authors.id"), nullable=False) + # Relationships author = relationship("Author", back_populates="books") + # Timestamps created_at = Column(DateTime, default=func.now()) updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) \ No newline at end of file