diff --git a/models/book.py b/models/book.py index 5163d00..10e9959 100644 --- a/models/book.py +++ b/models/book.py @@ -11,12 +11,13 @@ class Book(Base): title = Column(String, nullable=False, index=True) description = Column(String) isbn = Column(String, unique=True) - publication_year = Column(Integer) author_id = Column(String, ForeignKey("authors.id"), nullable=False) + publication_year = Column(Integer) + pages = Column(Integer) + genre = Column(String) + publisher = Column(String) - # 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 + updated_at = Column(DateTime, default=func.now(), onupdate=func.now()) + + author = relationship("Author", back_populates="books") \ No newline at end of file