|
| 1 | +# Generated by Django 4.2.7 on 2026-03-10 11:07 |
| 2 | + |
| 3 | +from django.db import migrations, models |
| 4 | + |
| 5 | + |
| 6 | +class Migration(migrations.Migration): |
| 7 | + |
| 8 | + dependencies = [ |
| 9 | + ('emails', '0002_campaign_senderidentity_emailtemplate_campaignlog_and_more'), |
| 10 | + ] |
| 11 | + |
| 12 | + operations = [ |
| 13 | + migrations.CreateModel( |
| 14 | + name='InboundEmail', |
| 15 | + fields=[ |
| 16 | + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), |
| 17 | + ('message_id', models.CharField(blank=True, db_index=True, default='', max_length=512)), |
| 18 | + ('from_email', models.EmailField(max_length=254)), |
| 19 | + ('from_name', models.CharField(blank=True, default='', max_length=255)), |
| 20 | + ('to_email', models.CharField(max_length=512)), |
| 21 | + ('cc', models.TextField(blank=True, default='')), |
| 22 | + ('reply_to', models.EmailField(blank=True, default='', max_length=254)), |
| 23 | + ('in_reply_to', models.CharField(blank=True, default='', max_length=512)), |
| 24 | + ('subject', models.CharField(blank=True, default='(no subject)', max_length=998)), |
| 25 | + ('html_body', models.TextField(blank=True, default='')), |
| 26 | + ('text_body', models.TextField(blank=True, default='')), |
| 27 | + ('preview_text', models.CharField(blank=True, default='', max_length=255)), |
| 28 | + ('status', models.CharField(choices=[('unread', 'Unread'), ('read', 'Read'), ('archived', 'Archived'), ('spam', 'Spam')], default='unread', max_length=16)), |
| 29 | + ('has_attachments', models.BooleanField(default=False)), |
| 30 | + ('attachments', models.JSONField(blank=True, default=list)), |
| 31 | + ('headers', models.JSONField(blank=True, default=dict)), |
| 32 | + ('raw_payload', models.JSONField(blank=True, default=dict, help_text='Full raw webhook payload for debugging')), |
| 33 | + ('spam_score', models.FloatField(blank=True, null=True)), |
| 34 | + ('received_at', models.DateTimeField(blank=True, help_text='Date header from the email itself', null=True)), |
| 35 | + ('created_at', models.DateTimeField(auto_now_add=True)), |
| 36 | + ], |
| 37 | + options={ |
| 38 | + 'verbose_name': 'Inbound Email', |
| 39 | + 'verbose_name_plural': 'Inbound Emails', |
| 40 | + 'ordering': ['-created_at'], |
| 41 | + 'indexes': [models.Index(fields=['status', 'created_at'], name='emails_inbo_status_ee4e51_idx'), models.Index(fields=['from_email', 'created_at'], name='emails_inbo_from_em_9ae48c_idx'), models.Index(fields=['message_id'], name='emails_inbo_message_5ff5ef_idx')], |
| 42 | + }, |
| 43 | + ), |
| 44 | + ] |
0 commit comments