From c3e4c4875993da834518c9f965a9a186f6eef239 Mon Sep 17 00:00:00 2001 From: Zach Mullen Date: Mon, 22 May 2023 13:36:47 -0400 Subject: [PATCH] Add manual index names where index names might get too long Some managed mongoDB providers limit index name lengths, and multi-column indexes' default names may exceed this. --- .../models/annotationelement.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/girder_annotation/girder_large_image_annotation/models/annotationelement.py b/girder_annotation/girder_large_image_annotation/models/annotationelement.py index 46d22c6aa..dcd0d809f 100644 --- a/girder_annotation/girder_large_image_annotation/models/annotationelement.py +++ b/girder_annotation/girder_large_image_annotation/models/annotationelement.py @@ -63,16 +63,22 @@ def initialize(self): ('bbox.lowx', SortDir.DESCENDING), ('bbox.highx', SortDir.ASCENDING), ('bbox.size', SortDir.DESCENDING), - ], {}), + ], { + 'name': 'annotationBboxIdx' + }), ([ ('annotationId', SortDir.ASCENDING), ('bbox.size', SortDir.DESCENDING), - ], {}), + ], { + 'name': 'annotationBboxSizeIdx' + }), ([ ('annotationId', SortDir.ASCENDING), ('_version', SortDir.DESCENDING), ('element.group', SortDir.ASCENDING), - ], {}), + ], { + 'name': 'annotationGroupIdx' + }), ([ ('created', SortDir.ASCENDING), ('_version', SortDir.ASCENDING),