forked from zulip/zulip
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
retention-period: Add archiving attachments feature.
- Add model with migration for attachments archiving. - Add archiving attachments to archiving tool. - Add tests. Fixes zulip#106
- Loading branch information
Showing
4 changed files
with
186 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import django.utils.timezone | ||
from django.conf import settings | ||
import zerver.lib.str_utils | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('zerver', '0054_archive_user_message'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ArchiveAttachment', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('file_name', models.TextField(db_index=True)), | ||
('path_id', models.TextField(db_index=True)), | ||
('is_realm_public', models.BooleanField(default=False)), | ||
('create_time', models.DateTimeField(default=django.utils.timezone.now, db_index=True)), | ||
('archived_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='data archived', db_index=True)), | ||
('messages', models.ManyToManyField(to='zerver.ArchiveMessage')), | ||
('owner', models.ForeignKey(to=settings.AUTH_USER_MODEL)), | ||
('realm', models.ForeignKey(blank=True, to='zerver.Realm', null=True)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
bases=(zerver.lib.str_utils.ModelReprMixin, models.Model), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters