Skip to content

Commit

Permalink
Added matching indexes to a number of models with ordering by multipl…
Browse files Browse the repository at this point in the history
…e keys.

 - Legacy-Id: 18664
  • Loading branch information
levkowetz committed Nov 9, 2020
1 parent 9da87c5 commit 088033d
Show file tree
Hide file tree
Showing 20 changed files with 226 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ietf/doc/migrations/0038_auto_20201109_0429.py
@@ -0,0 +1,17 @@
# Generated by Django 2.2.17 on 2020-11-09 04:29

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('doc', '0037_clean_up_missing_docaliases'),
]

operations = [
migrations.AddIndex(
model_name='docevent',
index=models.Index(fields=['-time', '-id'], name='doc_doceven_time_1a258f_idx'),
),
]
21 changes: 21 additions & 0 deletions ietf/doc/migrations/0039_auto_20201109_0439.py
@@ -0,0 +1,21 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('doc', '0038_auto_20201109_0429'),
]

operations = [
migrations.AddIndex(
model_name='dochistoryauthor',
index=models.Index(fields=['document', 'order'], name='doc_dochist_documen_7e2441_idx'),
),
migrations.AddIndex(
model_name='documentauthor',
index=models.Index(fields=['document', 'order'], name='doc_documen_documen_7fabe2_idx'),
),
]
4 changes: 4 additions & 0 deletions ietf/doc/models.py
Expand Up @@ -618,6 +618,9 @@ def formatted_email(self):
class Meta:
abstract = True
ordering = ["document", "order"]
indexes = [
models.Index(fields=['document', 'order']),
]

class DocumentAuthor(DocumentAuthorInfo):
document = ForeignKey('Document')
Expand Down Expand Up @@ -1076,6 +1079,7 @@ class Meta:
ordering = ['-time', '-id']
indexes = [
models.Index(fields=['type', 'doc']),
models.Index(fields=['-time', '-id']),
]

class NewRevisionDocEvent(DocEvent):
Expand Down
17 changes: 17 additions & 0 deletions ietf/group/migrations/0038_auto_20201109_0439.py
@@ -0,0 +1,17 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('group', '0037_initial_yc_roles'),
]

operations = [
migrations.AddIndex(
model_name='groupevent',
index=models.Index(fields=['-time', '-id'], name='group_group_time_ee7c7c_idx'),
),
]
3 changes: 3 additions & 0 deletions ietf/group/models.py
Expand Up @@ -334,6 +334,9 @@ def __str__(self):

class Meta:
ordering = ['-time', 'id']
indexes = [
models.Index(fields=['-time', '-id']),
]

class ChangeStateGroupEvent(GroupEvent):
state = ForeignKey(GroupStateName)
Expand Down
3 changes: 3 additions & 0 deletions ietf/iesg/models.py
Expand Up @@ -88,3 +88,6 @@ def __str__(self):

class Meta:
ordering = ['-date']
indexes = [
models.Index(fields=['-date',]),
]
21 changes: 21 additions & 0 deletions ietf/ipr/migrations/0008_auto_20201109_0439.py
@@ -0,0 +1,21 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('ipr', '0007_create_ipr_doc_events'),
]

operations = [
migrations.AddIndex(
model_name='iprdisclosurebase',
index=models.Index(fields=['-time', '-id'], name='ipr_iprdisc_time_846a78_idx'),
),
migrations.AddIndex(
model_name='iprevent',
index=models.Index(fields=['-time', '-id'], name='ipr_ipreven_time_9630c4_idx'),
),
]
6 changes: 6 additions & 0 deletions ietf/ipr/models.py
Expand Up @@ -30,6 +30,9 @@ class IprDisclosureBase(models.Model):

class Meta:
ordering = ['-time', '-id']
indexes = [
models.Index(fields=['-time', '-id']),
]

def __str__(self):
return self.title
Expand Down Expand Up @@ -247,6 +250,9 @@ def create_doc_events(self):

class Meta:
ordering = ['-time', '-id']
indexes = [
models.Index(fields=['-time', '-id']),
]

class LegacyMigrationIprEvent(IprEvent):
"""A subclass of IprEvent specifically for capturing contents of legacy_url_0,
Expand Down
17 changes: 17 additions & 0 deletions ietf/liaisons/migrations/0007_auto_20201109_0439.py
@@ -0,0 +1,17 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('liaisons', '0006_document_primary_key_cleanup'),
]

operations = [
migrations.AddIndex(
model_name='liaisonstatementevent',
index=models.Index(fields=['-time', '-id'], name='liaisons_li_time_3e1646_idx'),
),
]
3 changes: 3 additions & 0 deletions ietf/liaisons/models.py
Expand Up @@ -238,3 +238,6 @@ def __str__(self):

class Meta:
ordering = ['-time', '-id']
indexes = [
models.Index(fields=['-time', '-id']),
]
21 changes: 21 additions & 0 deletions ietf/meeting/migrations/0039_auto_20201109_0439.py
@@ -0,0 +1,21 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('meeting', '0038_auto_20201005_1123'),
]

operations = [
migrations.AddIndex(
model_name='meeting',
index=models.Index(fields=['-date', '-id'], name='meeting_mee_date_40ca21_idx'),
),
migrations.AddIndex(
model_name='timeslot',
index=models.Index(fields=['-time', '-id'], name='meeting_tim_time_b802cb_idx'),
),
]
6 changes: 6 additions & 0 deletions ietf/meeting/models.py
Expand Up @@ -312,6 +312,9 @@ def previous_meeting(self):

class Meta:
ordering = ["-date", "-id"]
indexes = [
models.Index(fields=['-date', '-id']),
]

# === Rooms, Resources, Floorplans =============================================

Expand Down Expand Up @@ -622,6 +625,9 @@ def slot_to_the_right(self):

class Meta:
ordering = ["-time", "-id"]
indexes = [
models.Index(fields=['-time', '-id']),
]


# end of TimeSlot
Expand Down
21 changes: 21 additions & 0 deletions ietf/message/migrations/0011_auto_20201109_0439.py
@@ -0,0 +1,21 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('message', '0010_fix_content_type'),
]

operations = [
migrations.AddIndex(
model_name='message',
index=models.Index(fields=['time'], name='message_mes_time_20eabf_idx'),
),
migrations.AddIndex(
model_name='sendqueue',
index=models.Index(fields=['time'], name='message_sen_time_07ab31_idx'),
),
]
6 changes: 6 additions & 0 deletions ietf/message/models.py
Expand Up @@ -37,6 +37,9 @@ class Message(models.Model):

class Meta:
ordering = ['time']
indexes = [
models.Index(fields=['time',]),
]

def __str__(self):
return "'%s' %s -> %s" % (self.subject, self.frm, self.to)
Expand Down Expand Up @@ -71,6 +74,9 @@ class SendQueue(models.Model):

class Meta:
ordering = ['time']
indexes = [
models.Index(fields=['time',]),
]

def __str__(self):
return "'%s' %s -> %s (sent at %s)" % (self.message.subject, self.message.frm, self.message.to, self.sent_at or "<not yet>")
Expand Down
17 changes: 17 additions & 0 deletions ietf/nomcom/migrations/0009_auto_20201109_0439.py
@@ -0,0 +1,17 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('nomcom', '0008_auto_20201008_0506'),
]

operations = [
migrations.AddIndex(
model_name='feedback',
index=models.Index(fields=['time'], name='nomcom_feed_time_35cf38_idx'),
),
]
3 changes: 3 additions & 0 deletions ietf/nomcom/models.py
Expand Up @@ -296,6 +296,9 @@ def __str__(self):

class Meta:
ordering = ['time']
indexes = [
models.Index(fields=['time',]),
]

class FeedbackLastSeen(models.Model):
reviewer = ForeignKey(Person)
Expand Down
17 changes: 17 additions & 0 deletions ietf/person/migrations/0018_auto_20201109_0439.py
@@ -0,0 +1,17 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('person', '0017_auto_20201028_0902'),
]

operations = [
migrations.AddIndex(
model_name='personevent',
index=models.Index(fields=['-time', '-id'], name='person_pers_time_8dfbc5_idx'),
),
]
3 changes: 3 additions & 0 deletions ietf/person/models.py
Expand Up @@ -415,6 +415,9 @@ def __str__(self):

class Meta:
ordering = ['-time', '-id']
indexes = [
models.Index(fields=['-time', '-id']),
]

class PersonApiKeyEvent(PersonEvent):
key = ForeignKey(PersonalApiKey)
Expand Down
17 changes: 17 additions & 0 deletions ietf/submit/migrations/0007_auto_20201109_0439.py
@@ -0,0 +1,17 @@
# Generated by Django 2.2.17 on 2020-11-09 04:39

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('submit', '0006_submission_xml_version'),
]

operations = [
migrations.AddIndex(
model_name='submissionevent',
index=models.Index(fields=['-time', '-id'], name='submit_subm_time_fcd790_idx'),
),
]
3 changes: 3 additions & 0 deletions ietf/submit/models.py
Expand Up @@ -107,6 +107,9 @@ def __str__(self):

class Meta:
ordering = ("-time", "-id")
indexes = [
models.Index(fields=['-time', '-id']),
]


class Preapproval(models.Model):
Expand Down

0 comments on commit 088033d

Please sign in to comment.