messages: Remove unconditional topic indexes.

This commit is contained in:
Alex Vandiver
2025-03-17 18:18:14 +00:00
committed by Tim Abbott
parent d978363a75
commit fd127b4191
2 changed files with 25 additions and 23 deletions

View File

@@ -0,0 +1,25 @@
from django.contrib.postgres.operations import RemoveIndexConcurrently
from django.db import migrations
class Migration(migrations.Migration):
atomic = False
dependencies = [
("zerver", "0693_add_conditional_indexes_for_topic"),
]
operations = [
RemoveIndexConcurrently(
model_name="message",
name="zerver_message_realm_upper_subject_all",
),
RemoveIndexConcurrently(
model_name="message",
name="zerver_message_realm_recipient_upper_subject_all",
),
RemoveIndexConcurrently(
model_name="message",
name="zerver_message_realm_recipient_subject_all",
),
]

View File

@@ -205,29 +205,6 @@ class Message(AbstractMessage):
"date_sent",
name="zerver_message_realm_date_sent",
),
models.Index(
# To be removed shortly
"realm_id",
Upper("subject"),
F("id").desc(nulls_last=True),
name="zerver_message_realm_upper_subject_all",
),
models.Index(
# To be removed shortly
"realm_id",
"recipient_id",
Upper("subject"),
F("id").desc(nulls_last=True),
name="zerver_message_realm_recipient_upper_subject_all",
),
models.Index(
# To be removed shortly
"realm_id",
"recipient_id",
"subject",
F("id").desc(nulls_last=True),
name="zerver_message_realm_recipient_subject_all",
),
models.Index(
# For users searching by topic (but not stream), which
# is done case-insensitively