Skip to content

Commit

Permalink
refactor: change db indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
whdalsrnt committed Jan 6, 2024
1 parent 55fcc20 commit aea52d9
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/spaceone/cost_analysis/model/budget_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Budget(MongoModel):
"ordering": ["name"],
"indexes": [
"name",
"resource_group",
"data_source_id",
"project_id",
"workspace_id",
Expand Down
3 changes: 2 additions & 1 deletion src/spaceone/cost_analysis/model/budget_usage_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ class BudgetUsage(MongoModel):
"budget_id",
"name",
"date",
"project_id",
"resource_group",
"data_source_id",
"project_id",
"workspace_id",
"domain_id",
],
Expand Down
9 changes: 8 additions & 1 deletion src/spaceone/cost_analysis/model/data_source_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,12 @@ class DataSource(MongoModel):
"provider",
],
"ordering": ["name"],
"indexes": ["state", "data_source_type", "provider", "workspace_id", "domain_id"],
"indexes": [
"state",
"data_source_type",
"provider",
"resource_group",
"workspace_id",
"domain_id"
],
}
1 change: 1 addition & 0 deletions src/spaceone/cost_analysis/model/data_source_rule_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class DataSourceRule(MongoModel):
# 'data_source_rule_id',
"order",
"conditions_policy",
"resource_group",
"data_source_id",
"workspace_id",
"domain_id",
Expand Down
2 changes: 2 additions & 0 deletions src/spaceone/cost_analysis/model/job_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ class Job(MongoModel):
"indexes": [
# 'job_id',
"status",
"resource_group",
"data_source_id",
"workspace_id",
"domain_id",
"created_at",
],
Expand Down
2 changes: 2 additions & 0 deletions src/spaceone/cost_analysis/model/job_task_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class JobTask(MongoModel):
# 'job_task_id',
"status",
"job_id",
"resource_group",
"data_source_id",
"workspace_id",
"domain_id",
"created_at",
],
Expand Down

0 comments on commit aea52d9

Please sign in to comment.