Skip to content

test: add publisher field - #136

Closed
vikram-dagger wants to merge 1 commit into
mainfrom
update-api-publisher
Closed

test: add publisher field#136
vikram-dagger wants to merge 1 commit into
mainfrom
update-api-publisher

Conversation

@vikram-dagger

Copy link
Copy Markdown
Owner

No description provided.

@greptile-apps

greptile-apps Bot commented Sep 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds a required publisher column to the Book ORM model.

  • Adds a non-nullable String(255) publisher field.
  • Does not update the API schemas, persistence calls, SQL initialization schema, or database migration path needed to support that field.

Confidence Score: 3/5

This PR is not safe to merge until book creation supplies publisher and deployed database schemas are migrated to include the new column.

Fresh ORM-created tables reject current inserts because publisher is never supplied, while SQL-initialized and existing databases lack the mapped column entirely.

Files Needing Attention: models.py

Important Files Changed

Filename Overview
models.py Adds a required ORM field that current create requests cannot populate and deployed database schemas do not contain.

Reviews (1): Last reviewed commit: "test: add publisher field" | Re-trigger Greptile

Comment thread models.py
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.

Comment thread models.py
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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant