Add Book model

This commit is contained in:
Backend IM Bot 2025-03-25 23:19:51 +00:00
parent 06dbab2d68
commit f4565e203e

View File

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