From 1ffcd5e6d1a5e0043674abd08f3b5abdedd8eeca Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sat, 14 Jan 2023 12:01:44 -0700 Subject: [PATCH] Add timelineevent.created index --- ...0009_alter_timelineevent_index_together.py | 22 +++++++++++++++++++ activities/models/timeline_event.py | 1 + 2 files changed, 23 insertions(+) create mode 100644 activities/migrations/0009_alter_timelineevent_index_together.py diff --git a/activities/migrations/0009_alter_timelineevent_index_together.py b/activities/migrations/0009_alter_timelineevent_index_together.py new file mode 100644 index 0000000..2670403 --- /dev/null +++ b/activities/migrations/0009_alter_timelineevent_index_together.py @@ -0,0 +1,22 @@ +# Generated by Django 4.1.4 on 2023-01-14 19:01 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("users", "0011_announcement"), + ("activities", "0008_state_and_post_indexes"), + ] + + operations = [ + migrations.AlterIndexTogether( + name="timelineevent", + index_together={ + ("identity", "type", "subject_post", "subject_identity"), + ("identity", "type", "subject_identity"), + ("identity", "created"), + }, + ), + ] diff --git a/activities/models/timeline_event.py b/activities/models/timeline_event.py index e77efb9..c51dec1 100644 --- a/activities/models/timeline_event.py +++ b/activities/models/timeline_event.py @@ -62,6 +62,7 @@ class TimelineEvent(models.Model): # This relies on a DB that can use left subsets of indexes ("identity", "type", "subject_post", "subject_identity"), ("identity", "type", "subject_identity"), + ("identity", "created"), ] ### Alternate constructors ###