mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-26 03:21:05 +00:00
Add index for finding all statuses in a thread
This commit is contained in:
parent
5082806b82
commit
5cfe7eca6f
2 changed files with 20 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 3.2.25 on 2024-04-03 19:05
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("bookwyrm", "0199_status_bookwyrm_st_remote__06aeba_idx"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddIndex(
|
||||||
|
model_name="status",
|
||||||
|
index=models.Index(
|
||||||
|
fields=["thread_id"], name="bookwyrm_st_thread__cf064f_idx"
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -82,6 +82,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
|
||||||
ordering = ("-published_date",)
|
ordering = ("-published_date",)
|
||||||
indexes = [
|
indexes = [
|
||||||
models.Index(fields=["remote_id"]),
|
models.Index(fields=["remote_id"]),
|
||||||
|
models.Index(fields=["thread_id"]),
|
||||||
]
|
]
|
||||||
|
|
||||||
def save(self, *args, **kwargs):
|
def save(self, *args, **kwargs):
|
||||||
|
|
Loading…
Reference in a new issue