retention: Use new ArchiveTransaction model.

We add a new model, ArchiveTransaction, to tie archived objects together
in a coherent way, according to the batches in which they are archived.
This enables making a better system for restoring from archive, and it
seems just more sensible to tie the archived objects in this way, rather
the somewhat vague setting of archive_timestamp to each object using
timezone_now().
This commit is contained in:
Mateusz Mandera
2019-06-18 19:54:09 +02:00
committed by Tim Abbott
parent e8d49330f2
commit a2cce62c1c
4 changed files with 90 additions and 24 deletions

View File

@@ -88,6 +88,7 @@ ALL_ZULIP_TABLES = {
'zerver_attachment_messages',
'zerver_archivedreaction',
'zerver_archivedsubmessage',
'zerver_archivetransaction',
'zerver_botconfigdata',
'zerver_botstoragedata',
'zerver_client',
@@ -176,6 +177,7 @@ NON_EXPORTED_TABLES = {
'zerver_archivedattachment_messages',
'zerver_archivedreaction',
'zerver_archivedsubmessage',
'zerver_archivetransaction',
# Social auth tables are not needed post-export, since we don't
# use any of this state outside of a direct authentication flow.