Skip to content

Commit

Permalink
chore: update dashboard_alias index name (#4724)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewelwell authored Oct 14, 2024
1 parent 1c71905 commit 88acdfa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
7 changes: 6 additions & 1 deletion api/edge_api/identities/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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

0 comments on commit 88acdfa

Please sign in to comment.