# Generated by Django 4.1.3 on 2022-12-15 00:13

from django.db import migrations, models
import django.db.models.deletion
import rest.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('account', '0012_settings_settingsmetadata'),
        ('medialib', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Mailbox',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('email', models.CharField(db_index=True, max_length=255)),
                ('state', models.IntegerField(db_index=True, default=0)),
                ('tq_app', models.CharField(default=None, max_length=255, null=True)),
                ('tq_handler', models.CharField(default=None, max_length=255, null=True)),
                ('tq_channel', models.CharField(default=None, max_length=255, null=True)),
            ],
            bases=(models.Model, rest.models.RestModel, rest.models.MetaDataModel),
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('sent_at', models.DateTimeField()),
                ('state', models.IntegerField(db_index=True, default=0)),
                ('to_email', models.CharField(db_index=True, max_length=255)),
                ('to_name', models.CharField(default=None, max_length=255, null=True)),
                ('to', models.TextField()),
                ('cc', models.TextField()),
                ('from_email', models.CharField(db_index=True, max_length=255)),
                ('from_name', models.CharField(default=None, max_length=255, null=True)),
                ('subject', models.CharField(default=None, max_length=255, null=True)),
                ('message', models.TextField(default=None, null=True)),
                ('body', models.TextField(default=None, null=True)),
                ('html', models.TextField(default=None, null=True)),
            ],
            bases=(models.Model, rest.models.RestModel),
        ),
        migrations.CreateModel(
            name='MailboxMetaData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.CharField(blank=True, db_index=True, default=None, max_length=32, null=True)),
                ('key', models.CharField(db_index=True, max_length=80)),
                ('value_format', models.CharField(max_length=16)),
                ('value', models.TextField()),
                ('int_value', models.IntegerField(blank=True, default=None, null=True)),
                ('float_value', models.IntegerField(blank=True, default=None, null=True)),
                ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='properties', to='inbox.mailbox')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Complaint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('address', models.CharField(db_index=True, max_length=255)),
                ('kind', models.CharField(db_index=True, max_length=32)),
                ('reason', models.TextField(blank=True, default=None, null=True)),
                ('user_agent', models.CharField(blank=True, default=None, max_length=255, null=True)),
                ('source', models.CharField(blank=True, default=None, max_length=255, null=True)),
                ('source_ip', models.CharField(blank=True, default=None, max_length=64, null=True)),
                ('user', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='emails_complaints', to='account.member')),
            ],
            bases=(models.Model, rest.models.RestModel),
        ),
        migrations.CreateModel(
            name='Bounce',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('address', models.CharField(db_index=True, max_length=255)),
                ('kind', models.CharField(db_index=True, max_length=32)),
                ('reason', models.TextField(blank=True, default=None, null=True)),
                ('reporter', models.CharField(blank=True, default=None, max_length=255, null=True)),
                ('code', models.CharField(blank=True, default=None, max_length=32, null=True)),
                ('source', models.CharField(blank=True, default=None, max_length=255, null=True)),
                ('source_ip', models.CharField(blank=True, default=None, max_length=64, null=True)),
                ('user', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='emails_bounced', to='account.member')),
            ],
            bases=(models.Model, rest.models.RestModel),
        ),
        migrations.CreateModel(
            name='Attachment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('name', models.CharField(default=None, max_length=255, null=True)),
                ('media', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='medialib.mediaitem')),
                ('message', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='inbox.message')),
            ],
            bases=(models.Model, rest.models.RestModel),
        ),
    ]
