Skip to content

Commit

Permalink
And even more indices...
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenswat committed Feb 7, 2024
1 parent 670e075 commit 89a60dc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generated by Django 4.1.13 on 2024-02-07 16:21

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
(
"abyssal_modules",
"0023_moduleattribute_abyssal_mod_value_8f8ca9_idx_and_more",
),
]

operations = [
migrations.AddIndex(
model_name="moduleattribute",
index=models.Index(
models.F("attribute"),
models.OrderBy(models.F("value")),
name="attribute_value_asc_idx",
),
),
migrations.AddIndex(
model_name="moduleattribute",
index=models.Index(
models.F("attribute"),
models.OrderBy(models.F("value"), descending=True),
name="attribute_value_desc_idx",
),
),
]
6 changes: 6 additions & 0 deletions backend/abyssal_modules/models/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ class Meta:
models.Index(fields=["module", "attribute", "value"]),
models.Index(fields=["value"]),
models.Index(fields=["-value"]),
models.Index(
F("attribute"), F("value").asc(), name="attribute_value_asc_idx"
),
models.Index(
F("attribute"), F("value").desc(), name="attribute_value_desc_idx"
),
]


Expand Down

0 comments on commit 89a60dc

Please sign in to comment.