# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-04-10 06:14
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Alternative',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('mimetype', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Attachment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('filename', models.CharField(blank=True, default=None, max_length=255, null=True)),
                ('content', models.BinaryField(blank=True, default=None, null=True)),
                ('mimetype', models.CharField(blank=True, default=None, max_length=255, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Email',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('m_from', models.TextField(verbose_name='From')),
                ('subject', models.CharField(max_length=78)),
                ('body', models.TextField()),
                ('created', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Header',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(max_length=255)),
                ('value', models.CharField(max_length=255)),
                ('email', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='headers', to='mcfeely.Email')),
            ],
        ),
        migrations.CreateModel(
            name='Queue',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('queue', models.CharField(max_length=50)),
                ('description', models.CharField(max_length=200, verbose_name='Queue Description')),
                ('display_to_user', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Recipient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', models.CharField(max_length=254)),
                ('recipient_type', models.CharField(choices=[('to', 'To'), ('cc', 'CC'), ('bcc', 'BCC')], max_length=3)),
                ('status', models.CharField(choices=[('in_queue', 'In Queue'), ('sent_success', 'Sent Successfuly'), ('deferred', 'Deferred'), ('blocked_unsubscribe', 'Blocked by unsubscribe'), ('failure', 'Failure')], default='in_queue', max_length=100)),
                ('email', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mcfeely.Email')),
            ],
        ),
        migrations.CreateModel(
            name='Unsubscribe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', models.EmailField(max_length=254, verbose_name='Email Address')),
                ('added', models.DateTimeField(auto_now_add=True)),
                ('queue', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='mcfeely.Queue')),
            ],
            options={
                'verbose_name': 'Usubscribe',
                'verbose_name_plural': 'Unsubscribe',
            },
        ),
        migrations.AddField(
            model_name='email',
            name='queue',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mcfeely.Queue'),
        ),
        migrations.AddField(
            model_name='attachment',
            name='email',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='mcfeely.Email'),
        ),
        migrations.AddField(
            model_name='alternative',
            name='email',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='alternatives', to='mcfeely.Email'),
        ),
        migrations.AlterUniqueTogether(
            name='unsubscribe',
            unique_together=set([('address', 'queue')]),
        ),
    ]
