From 9bdd18c1e2cafce9b6390ceffdf190b5d27cb645 Mon Sep 17 00:00:00 2001 From: Keegan Landrigan Date: Tue, 11 May 2021 21:05:44 +0000 Subject: [PATCH] additional indexes --- dispatch/migrations/0107_auto_20210511_1354.py | 17 +++++++++++++++++ dispatch/migrations/0108_auto_20210511_1359.py | 17 +++++++++++++++++ dispatch/modules/content/models.py | 2 ++ 3 files changed, 36 insertions(+) create mode 100644 dispatch/migrations/0107_auto_20210511_1354.py create mode 100644 dispatch/migrations/0108_auto_20210511_1359.py diff --git a/dispatch/migrations/0107_auto_20210511_1354.py b/dispatch/migrations/0107_auto_20210511_1354.py new file mode 100644 index 000000000..7191c7c77 --- /dev/null +++ b/dispatch/migrations/0107_auto_20210511_1354.py @@ -0,0 +1,17 @@ +# Generated by Django 3.1.8 on 2021-05-11 20:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dispatch', '0106_auto_20210511_1238'), + ] + + operations = [ + migrations.AddIndex( + model_name='subsection', + index=models.Index(fields=['slug', 'section'], name='dispatch_su_slug_27e9d6_idx'), + ), + ] diff --git a/dispatch/migrations/0108_auto_20210511_1359.py b/dispatch/migrations/0108_auto_20210511_1359.py new file mode 100644 index 000000000..04ba6fecb --- /dev/null +++ b/dispatch/migrations/0108_auto_20210511_1359.py @@ -0,0 +1,17 @@ +# Generated by Django 3.1.8 on 2021-05-11 20:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('dispatch', '0107_auto_20210511_1354'), + ] + + operations = [ + migrations.AddIndex( + model_name='article', + index=models.Index(fields=['subsection'], name='dispatch_ar_subsect_f813dd_idx'), + ), + ] diff --git a/dispatch/modules/content/models.py b/dispatch/modules/content/models.py index 39834cde3..dacbe5891 100644 --- a/dispatch/modules/content/models.py +++ b/dispatch/modules/content/models.py @@ -423,6 +423,7 @@ class Meta: models.Index(fields=['-published_at']), models.Index(fields=['head', 'is_published']), models.Index(fields=['section']), + models.Index(fields=['subsection']), ] class Subsection(Model, AuthorMixin): @@ -452,6 +453,7 @@ def get_absolute_url(self): class Meta: indexes = [ models.Index(fields=['slug']), + models.Index(fields=['slug','section']), ] class Page(Publishable):