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 creation

When a book is created, BookIn and create_book supply only the title and author, leaving this non-nullable column unset and causing the commit to fail with a constraint violation and the API to return 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 Deployed schemas lack publisher

If the application uses a database initialized from the unchanged db.sql or an existing persistent database, create_all does not add this column, so ORM reads and writes reference a nonexistent publisher column and fail.


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