Skip to content

Commit

Permalink
rename unique constraint since we need to temporarily keep both
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-genson committed Mar 19, 2024
1 parent 724ea49 commit 8c7789a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def upgrade():
["users.id"],
),
sa.PrimaryKeyConstraint("user_id", "recipe_id", "id"),
sa.UniqueConstraint("user_id", "recipe_id", name="user_id_recipe_id_key"),
sa.UniqueConstraint("user_id", "recipe_id", name="user_id_recipe_id_rating_key"),
)
op.create_index(op.f("ix_users_to_recipes_created_at"), "users_to_recipes", ["created_at"], unique=False)
op.create_index(op.f("ix_users_to_recipes_is_favorite"), "users_to_recipes", ["is_favorite"], unique=False)
Expand Down
2 changes: 1 addition & 1 deletion mealie/db/models/users/user_to_recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class UserToRecipe(SqlAlchemyBase, BaseMixins):
__tablename__ = "users_to_recipes"
__table_args__ = (UniqueConstraint("user_id", "recipe_id", name="user_id_recipe_id_key"),)
__table_args__ = (UniqueConstraint("user_id", "recipe_id", name="user_id_recipe_id_rating_key"),)
id: Mapped[GUID] = mapped_column(GUID, primary_key=True, default=GUID.generate)

user_id = Column(GUID, ForeignKey("users.id"), index=True, primary_key=True)
Expand Down

0 comments on commit 8c7789a

Please sign in to comment.