Files
zulip/zerver/migrations
Mateusz Mandera 6ef28773a1 migrations: Fix migration 0574 to handle edge-case DirectMessageGroups.
The Django ORM query would not work correctly for pathological
DirectMessageGroups with no Subscription rows. When the Subquery gave
empty results, the UPDATE would set group_size to null - when the point
of the migration was exactly to make sure this column is always set and
allow making the column non-nullable in 0575.

Such DirectMessageGroups can occur as a result doing .delete() on all
UserProfiles that were in the group - or by doing realm deletion via
either .delete() or `manage.py delete_realm`.

The natural choice for group_size of these objects is 0. The simple SQL
query naturally achieves this result, without needing any special
handling for this case.

(cherry picked from commit 60e166bcd0)
2025-03-26 10:55:07 -07:00
..
2023-02-02 10:40:13 -08:00
2023-02-02 10:40:13 -08:00