Skip to content

Commit

Permalink
Remove index. Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Dec 14, 2023
1 parent d41c654 commit 4b6f209
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,10 @@
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("prices", sa.Column("product_name", sa.String(), nullable=True))
op.create_index(
op.f("ix_prices_product_name"), "prices", ["product_name"], unique=False
)
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f("ix_prices_product_name"), table_name="prices")
op.drop_column("prices", "product_name")
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class Price(Base):
id = Column(Integer, primary_key=True, index=True)

product_code = Column(String, nullable=True, index=True)
product_name = Column(String, nullable=True, index=True)
product_name = Column(String, nullable=True)
category_tag = Column(String, nullable=True, index=True)
labels_tags = Column(JSONVariant, nullable=True, index=True)
product_id: Mapped[int] = mapped_column(ForeignKey("products.id"), nullable=True)
Expand Down
2 changes: 1 addition & 1 deletion app/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PriceCreate(BaseModel):
examples=["16584958", "8001505005707"],
)
product_name: str | None = Field(
defaul=None,
default=None,
min_length=1,
description="name of the product, as displayed on the receipt or the price tag.",
examples=["PATE NOCCIOLATA BIO 700G"],
Expand Down

0 comments on commit 4b6f209

Please sign in to comment.