# Generated by Django 2.0.2 on 2018-03-18 19:05

from django.db import migrations, models
import django.db.models.deletion
import django_email_center.utils


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='EmailLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email_from', models.EmailField(max_length=254, verbose_name='email from')),
                ('email_to', models.TextField(verbose_name='email to')),
                ('hidden_copy', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='has attachment')),
                ('subject', models.TextField(verbose_name='subject')),
                ('body', models.TextField(verbose_name='body')),
                ('body_html', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='body is html ')),
                ('has_attachment', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='has attachment')),
                ('register_datetime', models.DateTimeField(auto_now_add=True, verbose_name='register datetime')),
                ('sended', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='sended')),
                ('sended_datetime', models.DateTimeField(blank=True, null=True, verbose_name='sended datetime')),
                ('error_quantity', models.PositiveIntegerField(default=0, verbose_name='error quantity')),
                ('exceeded_max_retry', models.BooleanField(choices=[(True, 'Sim'), (False, 'Não')], default=False, verbose_name='exceeded max retry')),
            ],
            options={
                'ordering': ['register_datetime', 'subject'],
                'verbose_name': 'email log',
                'verbose_name_plural': 'emails logs',
            },
        ),
        migrations.CreateModel(
            name='EmailLogAttachment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(upload_to=django_email_center.utils.ATTACHMENT_DIRECTORY_PATH, verbose_name='attachment')),
                ('email_log', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_email_center.EmailLog', verbose_name='email log')),
            ],
            options={
                'verbose_name': 'email log attachment',
                'verbose_name_plural': 'emails logs attachments',
            },
        ),
        migrations.CreateModel(
            name='EmailLogError',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('message', models.TextField(verbose_name='message')),
                ('datetime', models.DateTimeField(auto_now_add=True, verbose_name='datetime')),
                ('email_log', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='django_email_center.EmailLog', verbose_name='email log')),
            ],
            options={
                'verbose_name': 'email log error',
                'verbose_name_plural': 'emails logs errors',
            },
        ),
        migrations.CreateModel(
            name='EmailStatisticDate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(verbose_name='date')),
                ('status', models.CharField(choices=[('failed', 'Failed'), ('sended', 'Sended'), ('registered', 'Registered')], max_length=20, verbose_name='tipo')),
                ('quantity', models.PositiveIntegerField(default=0, verbose_name='quantidade')),
            ],
            options={
                'verbose_name': 'email statistic by date',
                'verbose_name_plural': 'emails statistics by date',
            },
        ),
        migrations.AlterUniqueTogether(
            name='emailstatisticdate',
            unique_together={('date', 'status')},
        ),
    ]
