Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Book(Base):
id: Mapped[int] = mapped_column(primary_key=True, index=True)
title: Mapped[str] = mapped_column(String(255), index=True)
author: Mapped[str] = mapped_column(String(255))
publisher: Mapped[str] = mapped_column(String(255), nullable=False)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Required publisher breaks inserts

When any book is created, BookIn and the repository constructor supply only title and author, so the required publisher column receives no value and the request fails with an integrity error returned as HTTP 400.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Publisher column lacks migration

If a deployment already has a books table from an earlier release, create_all does not add the new publisher column, so subsequent ORM reads and writes reference a nonexistent column and fail.


# Pydantic models
class BookIn(BaseModel):
Expand Down
Loading