Files
zulip/zerver/migrations/0485_alter_usermessage_flags_and_add_index.py
Prakhar Pratyush c597de6a1d topic_mentions: Rename wildcard_mentioned to stream_wildcard_mentioned.
Rename the existing 'wildcard_mentioned' flag to
'stream_wildcard_mentioned'.

The 'wildcard_mentioned' flag is deprecated and exists for
backwards compatibility.

We have two separate flags for stream and topic wildcard mentions,
i.e., 'stream_wildcard_mentioned' and 'topic_wildcard_mentioned',
respectively.

* stream wildcard mentions: `@all`, `@everyone`, and `@stream`
* topic wildcard mentions: `@topic`

The `wildcard_mentioned` flag is included in the events and
API response if either `stream_wildcard_mentioned` or
`topic_wildcard_mentioned` is set.
2023-11-10 11:06:26 -08:00

70 lines
2.1 KiB
Python

# Generated by Django 4.2.6 on 2023-10-19 06:37
import bitfield.models
from django.contrib.postgres.operations import AddIndexConcurrently
from django.db import migrations, models
class Migration(migrations.Migration):
atomic = False
dependencies = [
("zerver", "0484_preregistrationrealm_default_language"),
]
operations = [
migrations.AlterField(
model_name="archivedusermessage",
name="flags",
field=bitfield.models.BitField(
[
"read",
"starred",
"collapsed",
"mentioned",
"stream_wildcard_mentioned",
"topic_wildcard_mentioned",
"group_mentioned",
"force_expand",
"force_collapse",
"has_alert_word",
"historical",
"is_private",
"active_mobile_push_notification",
],
default=0,
),
),
migrations.AlterField(
model_name="usermessage",
name="flags",
field=bitfield.models.BitField(
[
"read",
"starred",
"collapsed",
"mentioned",
"stream_wildcard_mentioned",
"topic_wildcard_mentioned",
"group_mentioned",
"force_expand",
"force_collapse",
"has_alert_word",
"historical",
"is_private",
"active_mobile_push_notification",
],
default=0,
),
),
AddIndexConcurrently(
model_name="usermessage",
index=models.Index(
"user_profile",
"message",
condition=models.Q(("flags__andnz", 120)),
name="zerver_usermessage_any_mentioned_message_id",
),
),
]