Add Book model
This commit is contained in:
parent
06dbab2d68
commit
f4565e203e
@ -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())
|
Loading…
x
Reference in New Issue
Block a user