I removed the unique constraint from the table class but I’m gettting unique constraint failed when I try to add data to the table of same name present in the table.
class Store(db.Model):
__tablename__ = "store_items"
id: Mapped[int] = mapped_column(Integer, primary_key=True)
name: Mapped[str] = mapped_column(String(250), nullable=False)
item1: Mapped[int] = mapped_column(Integer, nullable=False)
item2: Mapped[int] = mapped_column(Integer, nullable=False)
item3: Mapped[int] = mapped_column(Integer, nullable=False)
total: Mapped[int] = mapped_column(Integer, nullable=False)
I removed the unique constraint but it’s still not working
New contributor
Joseph Martin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.