Fix duplicate detection by using UUID in migration script
The migration script now counts duplicates based on the "uuid" field instead of "id". This ensures more accurate identification of duplicate "human_readable_id" entries.
This commit is contained in:
parent
146bbc3539
commit
ef2830d36a
1 changed files with 1 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ def fix_duplicates(apps, schema_editor):
|
|||
Order = apps.get_model("core", "Order")
|
||||
duplicates = (
|
||||
Order.objects.values("human_readable_id")
|
||||
.annotate(count=Count("id"))
|
||||
.annotate(count=Count("uuid"))
|
||||
.filter(count__gt=1)
|
||||
)
|
||||
for duplicate in duplicates:
|
||||
|
|
|
|||
Loading…
Reference in a new issue