Added matching indexes to a number of models with ordering by multiple keys.

- Legacy-Id: 18664
This commit is contained in:
Henrik Levkowetz 2020-11-09 19:41:12 +00:00
parent 9da87c59e1
commit 088033d843
20 changed files with 226 additions and 0 deletions

View file

@ -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'),
),
]

View file

@ -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'),
),
]

View file

@ -618,6 +618,9 @@ class DocumentAuthorInfo(models.Model):
class Meta:
abstract = True
ordering = ["document", "order"]
indexes = [
models.Index(fields=['document', 'order']),
]
class DocumentAuthor(DocumentAuthorInfo):
document = ForeignKey('Document')
@ -1076,6 +1079,7 @@ class DocEvent(models.Model):
ordering = ['-time', '-id']
indexes = [
models.Index(fields=['type', 'doc']),
models.Index(fields=['-time', '-id']),
]
class NewRevisionDocEvent(DocEvent):

View file

@ -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'),
),
]

View file

@ -334,6 +334,9 @@ class GroupEvent(models.Model):
class Meta:
ordering = ['-time', 'id']
indexes = [
models.Index(fields=['-time', '-id']),
]
class ChangeStateGroupEvent(GroupEvent):
state = ForeignKey(GroupStateName)

View file

@ -88,3 +88,6 @@ class TelechatDate(models.Model):
class Meta:
ordering = ['-date']
indexes = [
models.Index(fields=['-date',]),
]

View file

@ -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'),
),
]

View file

@ -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
@ -247,6 +250,9 @@ class IprEvent(models.Model):
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,

View file

@ -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'),
),
]

View file

@ -238,3 +238,6 @@ class LiaisonStatementEvent(models.Model):
class Meta:
ordering = ['-time', '-id']
indexes = [
models.Index(fields=['-time', '-id']),
]

View file

@ -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'),
),
]

View file

@ -312,6 +312,9 @@ class Meeting(models.Model):
class Meta:
ordering = ["-date", "-id"]
indexes = [
models.Index(fields=['-date', '-id']),
]
# === Rooms, Resources, Floorplans =============================================
@ -622,6 +625,9 @@ class TimeSlot(models.Model):
class Meta:
ordering = ["-time", "-id"]
indexes = [
models.Index(fields=['-time', '-id']),
]
# end of TimeSlot

View file

@ -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'),
),
]

View file

@ -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)
@ -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>")

View file

@ -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'),
),
]

View file

@ -296,6 +296,9 @@ class Feedback(models.Model):
class Meta:
ordering = ['time']
indexes = [
models.Index(fields=['time',]),
]
class FeedbackLastSeen(models.Model):
reviewer = ForeignKey(Person)

View file

@ -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'),
),
]

View file

@ -415,6 +415,9 @@ class PersonEvent(models.Model):
class Meta:
ordering = ['-time', '-id']
indexes = [
models.Index(fields=['-time', '-id']),
]
class PersonApiKeyEvent(PersonEvent):
key = ForeignKey(PersonalApiKey)

View file

@ -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'),
),
]

View file

@ -107,6 +107,9 @@ class SubmissionEvent(models.Model):
class Meta:
ordering = ("-time", "-id")
indexes = [
models.Index(fields=['-time', '-id']),
]
class Preapproval(models.Model):