mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-03 09:04:06 -05:00
fix: database unique constraints (#2594)
* fixed missing migration name * added unique constraints to all m2m tables * fixed bug trying to create duplicate tags * added more unique constraints * fixed duplicate seeder data * updated tests * fixed seed rollback error
This commit is contained in:
@@ -33,8 +33,13 @@ class ScrapedExtras:
|
||||
repo = ctx.repos.tags.by_group(ctx.group_id)
|
||||
|
||||
tags = []
|
||||
seen_tag_slugs: set[str] = set()
|
||||
for tag in self._tags:
|
||||
slugify_tag = slugify(tag)
|
||||
if slugify_tag in seen_tag_slugs:
|
||||
continue
|
||||
|
||||
seen_tag_slugs.add(slugify_tag)
|
||||
|
||||
# Check if tag exists
|
||||
if db_tag := repo.get_one(slugify_tag, "slug"):
|
||||
|
||||
Reference in New Issue
Block a user