mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-11 12:55:15 -05:00
fix: Tools Shouldn't Be Unique Across Groups (#2505)
* fixed type/abc errors in tests * fixed false positive multitentant tests * fix tools not allowing unique slugs across groups * fixed alembic refs --------- Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
@@ -36,8 +36,8 @@ class Tool(SqlAlchemyBase, BaseMixins):
|
||||
group_id: Mapped[GUID] = mapped_column(GUID, ForeignKey("groups.id"), nullable=False, index=True)
|
||||
group: Mapped["Group"] = orm.relationship("Group", back_populates="tools", foreign_keys=[group_id])
|
||||
|
||||
name: Mapped[str] = mapped_column(String, index=True, unique=True, nullable=False)
|
||||
slug: Mapped[str] = mapped_column(String, index=True, unique=True, nullable=False)
|
||||
name: Mapped[str] = mapped_column(String, index=True, nullable=False)
|
||||
slug: Mapped[str] = mapped_column(String, index=True, nullable=False)
|
||||
on_hand: Mapped[bool | None] = mapped_column(Boolean, default=False)
|
||||
recipes: Mapped[list["RecipeModel"]] = orm.relationship(
|
||||
"RecipeModel", secondary=recipes_to_tools, back_populates="tools"
|
||||
|
||||
Reference in New Issue
Block a user