Skip to content

Commit

Permalink
add indices to ocp label keys (project-koku#3665)
Browse files Browse the repository at this point in the history
  • Loading branch information
maskarb authored May 24, 2022
1 parent 21ad8ef commit 1cff14c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions koku/reporting/migrations/0255_ocp_label_indices.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Generated by Django 3.2.13 on 2022-05-24 17:23
from django.db import migrations
from django.db import models


class Migration(migrations.Migration):

dependencies = [
("reporting", "0254_oci_models"),
]

operations = [
migrations.AddIndex(
model_name="ocpstoragevolumelabelsummary",
index=models.Index(fields=["key"], name="openshift_vol_label_key_idx"),
),
migrations.AddIndex(
model_name="ocpusagepodlabelsummary",
index=models.Index(fields=["key"], name="openshift_pod_label_key_idx"),
),
]
2 changes: 2 additions & 0 deletions koku/reporting/provider/ocp/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ class Meta:

db_table = "reporting_ocpusagepodlabel_summary"
unique_together = ("key", "report_period", "namespace", "node")
indexes = [models.Index(fields=["key"], name="openshift_pod_label_key_idx")]

uuid = models.UUIDField(primary_key=True, default=uuid4)

Expand Down Expand Up @@ -483,6 +484,7 @@ class Meta:

db_table = "reporting_ocpstoragevolumelabel_summary"
unique_together = ("key", "report_period", "namespace", "node")
indexes = [models.Index(fields=["key"], name="openshift_vol_label_key_idx")]

uuid = models.UUIDField(primary_key=True, default=uuid4)

Expand Down

0 comments on commit 1cff14c

Please sign in to comment.