Skip to content

Commit

Permalink
Merge pull request #136 from whdalsrnt/master
Browse files Browse the repository at this point in the history
refactor: change db indexes
  • Loading branch information
whdalsrnt authored Jan 6, 2024
2 parents 9b0d466 + 9163a0d commit 55fcc20
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/spaceone/cost_analysis/model/budget_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ class Budget(MongoModel):
"ordering": ["name"],
"indexes": [
"name",
"project_id",
"data_source_id",
"project_id",
"workspace_id",
"domain_id",
],
}
5 changes: 4 additions & 1 deletion src/spaceone/cost_analysis/model/cost_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,14 @@ class Cost(MongoModel):
"domain_id",
"data_source_id",
"-billed_date",
"workspace_id",
"project_id",
"cost",
],
"name": "COMPOUND_INDEX_FOR_SEARCH",
},
{
"fields": ["domain_id", "cost_id", "project_id"],
"fields": ["domain_id", "cost_id", "workspace_id", "project_id"],
"name": "COMPOUND_INDEX_FOR_DELETE",
},
],
Expand Down Expand Up @@ -109,6 +110,7 @@ class MonthlyCost(MongoModel):
"domain_id",
"data_source_id",
"-billed_month",
"workspace_id",
"project_id",
"cost",
],
Expand All @@ -119,6 +121,7 @@ class MonthlyCost(MongoModel):
"domain_id",
"data_source_id",
"-billed_year",
"workspace_id",
"project_id",
"cost",
],
Expand Down
2 changes: 1 addition & 1 deletion src/spaceone/cost_analysis/model/cost_query_set_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ class CostQuerySet(MongoModel):
"workspace_id",
],
"ordering": ["name"],
"indexes": ["name", "user_id", "data_source_id", "domain_id"],
"indexes": ["name", "user_id", "data_source_id", "workspace_id", "domain_id"],
}
2 changes: 1 addition & 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,5 @@ class DataSource(MongoModel):
"provider",
],
"ordering": ["name"],
"indexes": ["name", "state", "data_source_type", "provider", "domain_id"],
"indexes": ["state", "data_source_type", "provider", "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 @@ -57,6 +57,7 @@ class DataSourceRule(MongoModel):
"order",
"conditions_policy",
"data_source_id",
"workspace_id",
"domain_id",
],
}

0 comments on commit 55fcc20

Please sign in to comment.