mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
models: Add a partial index on unread DMs.
This helps the find_first_unread_anchor call for DMs with a user.
This commit is contained in:
committed by
Tim Abbott
parent
04f7dd998b
commit
83acf70d0f
@@ -636,6 +636,15 @@ class UserMessage(AbstractUserMessage):
|
||||
condition=Q(flags__andnz=AbstractUserMessage.flags.is_private.mask),
|
||||
name="zerver_usermessage_is_private_message_id",
|
||||
),
|
||||
models.Index(
|
||||
"user_profile",
|
||||
"message",
|
||||
condition=(
|
||||
Q(flags__andnz=AbstractUserMessage.flags.is_private.mask)
|
||||
& Q(flags__andz=AbstractUserMessage.flags.read.mask)
|
||||
),
|
||||
name="zerver_usermessage_is_private_unread_message_id",
|
||||
),
|
||||
models.Index(
|
||||
"user_profile",
|
||||
"message",
|
||||
|
||||
Reference in New Issue
Block a user