-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fb75c5a OS-7661. regenerated live_demo.json 3908db3 OS-7679. Not validate stats length 6e994bb Merge feature/ml_artifacts into integration
- Loading branch information
Showing
90 changed files
with
3,931 additions
and
58 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
arcee/arcee_receiver/migrations/20240524090000_artifact_index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from mongodb_migrations.base import BaseMigration | ||
|
||
|
||
INDEX_NAME = 'RunIdCreatedAtDt' | ||
INDEX_FIELDS = ['run_id', '_created_at_dt'] | ||
|
||
|
||
class Migration(BaseMigration): | ||
def existing_indexes(self): | ||
return [x['name'] for x in self.db.artifact.list_indexes()] | ||
|
||
def upgrade(self): | ||
if INDEX_NAME not in self.existing_indexes(): | ||
self.db.artifact.create_index( | ||
[(key, 1) for key in INDEX_FIELDS], | ||
name=INDEX_NAME, | ||
background=True | ||
) | ||
|
||
def downgrade(self): | ||
if INDEX_NAME in self.existing_indexes(): | ||
self.db.artifact.drop_index(INDEX_NAME) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.