1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 07:39:41 +02: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:
Michael Genson 2023-10-07 14:23:13 -05:00 committed by GitHub
parent 247a4de283
commit a98e863bca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 222 additions and 15 deletions

View file

@ -656,7 +656,10 @@ def test_pagination_order_by_nested_model(
alphabet = ["a", "b", "c", "d", "e"]
labels = database.group_multi_purpose_labels.create_many(
[MultiPurposeLabelSave(group_id=unique_user.group_id, name=letter) for letter in alphabet]
[
MultiPurposeLabelSave(group_id=unique_user.group_id, name=letter + f"_{random_string()}")
for letter in alphabet
]
)
random.shuffle(labels)