Files
zulip/zerver/migrations
Prakhar Pratyush 1ac7c2b942 migration: Handle conflict in UserTopic when topic="" pre-exists.
When a channel has both "general chat" and "" topic and a user
has visibility policy configured for both the topics, then
the migration to rename "general chat" to "" resulted in error
as it violated '(user_profile_id, stream_id, lower(topic_name)'
unique constraint.

This commit fixes the error.

For each row with topic="general chat", we create a new row
with topic="". On conflict we update the visibility policy
of the existing row -- we prefer the visibility policy of
'general chat' topic over "" as we're renaming 'general chat'
to "" so the configured policy of 'general chat' should be
preferred and any "" topic created wouldn't be intentional
or would be for testing purpose as it is not announced yet.

Finally, we delete the rows with "general chat" topic.
2025-02-27 09:44:27 -08:00
..
2023-02-02 10:40:13 -08:00
2023-02-02 10:40:13 -08:00