email_mirror: Migrate missed message addresses from redis to database.

Addresses point 1 of #13533.

MissedMessageEmailAddress objects get tied to the specific that was
missed by the user. A useful benefit of that is that email message sent
to that address will handle topic changes - if the message that was
missed gets its topic changed, the email response will get posted under
the new topic, while in the old model it would get posted under the
old topic, which could potentially be confusing.

Migrating redis data to this new model is a bit tricky, so the migration
code has comments explaining some of the compromises made there, and
test_migrations.py tests handling of the various possible cases that
could arise.
This commit is contained in:
Mateusz Mandera
2019-12-26 13:46:55 +01:00
committed by Tim Abbott
parent 8a1d2bb5b6
commit 0974b0130d
7 changed files with 238 additions and 109 deletions

View File

@@ -417,6 +417,7 @@ python_rules = RuleList(
'zerver/migrations/0104_fix_unreads.py',
'zerver/migrations/0206_stream_rendered_description.py',
'zerver/migrations/0209_user_profile_no_empty_password.py',
'zerver/migrations/0260_missed_message_addresses_from_redis_to_db.py',
'pgroonga/migrations/0002_html_escape_subject.py',
]),
'description': "Don't import models or other code in migrations; see docs/subsystems/schema-migrations.md",