From 1cff14c6fa158bc4a728a691dd713fc34234c07f Mon Sep 17 00:00:00 2001 From: Michael Skarbek Date: Tue, 24 May 2022 14:17:39 -0400 Subject: [PATCH] add indices to ocp label keys (#3665) --- .../migrations/0255_ocp_label_indices.py | 21 +++++++++++++++++++ koku/reporting/provider/ocp/models.py | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 koku/reporting/migrations/0255_ocp_label_indices.py diff --git a/koku/reporting/migrations/0255_ocp_label_indices.py b/koku/reporting/migrations/0255_ocp_label_indices.py new file mode 100644 index 0000000000..5e31f9832c --- /dev/null +++ b/koku/reporting/migrations/0255_ocp_label_indices.py @@ -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"), + ), + ] diff --git a/koku/reporting/provider/ocp/models.py b/koku/reporting/provider/ocp/models.py index e291ea11c9..5d5af15089 100644 --- a/koku/reporting/provider/ocp/models.py +++ b/koku/reporting/provider/ocp/models.py @@ -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) @@ -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)