# Generated by Django 5.2 on 2025-04-19 01:15

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='BlackListedDomains',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('domain', models.CharField(db_index=True, max_length=255, unique=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
            ],
            options={
                'verbose_name': 'Blacklisted Domain',
                'verbose_name_plural': 'Blacklisted Domains',
            },
        ),
        migrations.CreateModel(
            name='SESStat',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(db_index=True, unique=True)),
                ('delivery_attempts', models.PositiveIntegerField()),
                ('bounces', models.PositiveIntegerField()),
                ('complaints', models.PositiveIntegerField()),
                ('rejects', models.PositiveIntegerField()),
            ],
            options={
                'verbose_name': 'SES Statistic',
                'verbose_name_plural': 'SES Statistics',
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='AwsSesUserAddon',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('unsubscribe', models.BooleanField(default=False)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='aws_ses', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'AWS SES User Addon',
                'verbose_name_plural': 'AWS SES User Addons',
            },
        ),
        migrations.CreateModel(
            name='BounceRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('email', models.EmailField(db_index=True, max_length=254)),
                ('bounce_type', models.CharField(blank=True, max_length=255, null=True)),
                ('bounce_sub_type', models.CharField(blank=True, max_length=255, null=True)),
                ('reporting_mta', models.CharField(blank=True, max_length=255, null=True)),
                ('status', models.CharField(blank=True, max_length=255, null=True)),
                ('action', models.CharField(blank=True, max_length=255, null=True)),
                ('feedback_id', models.TextField(blank=True, null=True)),
                ('diagnostic_code', models.CharField(blank=True, max_length=2048, null=True)),
                ('cleared', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'Bounce Record',
                'verbose_name_plural': 'Bounce Records',
                'indexes': [models.Index(fields=['email', 'timestamp'], name='django_aws__email_6bb737_idx')],
            },
        ),
        migrations.CreateModel(
            name='ComplaintRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('email', models.EmailField(db_index=True, max_length=254)),
                ('sub_type', models.CharField(blank=True, max_length=255, null=True)),
                ('feedback_id', models.TextField(blank=True, null=True)),
                ('feedback_type', models.CharField(blank=True, max_length=255, null=True)),
            ],
            options={
                'verbose_name': 'Complaint Record',
                'verbose_name_plural': 'Complaint Records',
                'indexes': [models.Index(fields=['email', 'timestamp'], name='django_aws__email_36ac11_idx')],
            },
        ),
        migrations.CreateModel(
            name='SendRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('source', models.EmailField(max_length=254)),
                ('destination', models.EmailField(db_index=True, max_length=254)),
                ('subject', models.TextField(blank=True, max_length=998, null=True)),
                ('message_id', models.TextField(blank=True, max_length=255, null=True)),
                ('aws_process_time', models.IntegerField(default=0)),
                ('smtp_response', models.CharField(blank=True, max_length=255, null=True)),
                ('status', models.CharField(blank=True, choices=[('Send', 'Send'), ('Delivery', 'Delivery')], max_length=20, null=True)),
            ],
            options={
                'verbose_name': 'Send Record',
                'verbose_name_plural': 'Send Records',
                'indexes': [models.Index(fields=['destination', 'timestamp'], name='django_aws__destina_e0db33_idx')],
            },
        ),
        migrations.CreateModel(
            name='UnknownRecord',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('event_type', models.CharField(blank=True, max_length=255, null=True)),
                ('aws_data', models.TextField(blank=True, null=True)),
            ],
            options={
                'verbose_name': 'Unknown Record',
                'verbose_name_plural': 'Unknown Records',
                'indexes': [models.Index(fields=['event_type', 'timestamp'], name='django_aws__event_t_ca3517_idx')],
            },
        ),
    ]
