Skip to content

Commit 9fbaf50

Browse files
committed
fix missing postgres function
1 parent 6ae23fa commit 9fbaf50

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/backend/core/management/commands/verify_tiered_storage.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from django.core.management.base import BaseCommand
1313
from django.db import transaction
14-
from django.db.models import Min
1514

1615
import pyzstd
1716

@@ -321,9 +320,9 @@ def re_encrypt_blobs(self):
321320
needs_rotate.filter(
322321
storage_location=BlobStorageLocationChoices.OBJECT_STORAGE
323322
)
324-
.values("sha256", "encryption_key_id")
325-
.annotate(repr_id=Min("id"))
326-
.values_list("repr_id", flat=True)
323+
.order_by("sha256", "encryption_key_id", "id")
324+
.distinct("sha256", "encryption_key_id")
325+
.values_list("id", flat=True)
327326
)
328327
worklist = postgres_ids + object_storage_ids
329328
if self.limit > 0:

0 commit comments

Comments
 (0)