From 88acdfa51a3f1b12edcef7c30ce4a54d67bca5bf Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 14 Oct 2024 15:51:27 +0100 Subject: [PATCH] chore: update dashboard_alias index name (#4724) --- api/conftest.py | 2 +- api/edge_api/identities/search.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/conftest.py b/api/conftest.py index 0d50b694cd26..334794d88339 100644 --- a/api/conftest.py +++ b/api/conftest.py @@ -1024,7 +1024,7 @@ def flagsmith_identities_table( "Projection": {"ProjectionType": "ALL"}, }, { - "IndexName": "environment_api_key-dashboard_alias-index", + "IndexName": "environment_api_key-dashboard_alias-index-v2", "KeySchema": [ {"AttributeName": "environment_api_key", "KeyType": "HASH"}, {"AttributeName": "dashboard_alias", "KeyType": "RANGE"}, diff --git a/api/edge_api/identities/search.py b/api/edge_api/identities/search.py index dcc4fd38d1ef..aed12f3a29a2 100644 --- a/api/edge_api/identities/search.py +++ b/api/edge_api/identities/search.py @@ -5,6 +5,9 @@ DASHBOARD_ALIAS_ATTRIBUTE = "dashboard_alias" DASHBOARD_ALIAS_SEARCH_PREFIX = f"{DASHBOARD_ALIAS_ATTRIBUTE}:" +IDENTIFIER_INDEX_NAME = "environment_api_key-identifier-index" +DASHBOARD_ALIAS_INDEX_NAME = "environment_api_key-dashboard_alias-index-v2" + class EdgeIdentitySearchType(enum.Enum): EQUAL = "EQUAL" @@ -25,4 +28,6 @@ def dynamo_search_method(self): @property def dynamo_index_name(self): - return f"environment_api_key-{self.search_attribute}-index" + if self.search_attribute == DASHBOARD_ALIAS_ATTRIBUTE: + return DASHBOARD_ALIAS_INDEX_NAME + return IDENTIFIER_INDEX_NAME