# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-16 11:32
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Drip',
            fields=[
                ('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(help_text='A unique name for this drip.', max_length=255, unique=True, verbose_name='Drip Name')),
                ('from_email', models.EmailField(blank=True, help_text='Set a custom from email.', max_length=254, null=True)),
                ('sender_name', models.CharField(blank=True, help_text='Set a name for a custom from email.', max_length=150, null=True)),
                ('subject_template', models.CharField(blank=True, max_length=200, null=True)),
                ('text_template', models.TextField(blank=True, null=True)),
                ('html_template', models.TextField(blank=True, null=True)),
                ('active', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DripRule',
            fields=[
                ('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('method_type', models.CharField(choices=[('filter', 'Filter'), ('exclude', 'Exclude')], default='filter', max_length=12)),
                ('field_name', models.CharField(max_length=128, verbose_name='Field name of User')),
                ('lookup_type', models.CharField(choices=[('exact', 'exactly'), ('iexact', 'exactly (case insensitive)'), ('contains', 'contains'), ('icontains', 'contains (case insensitive)'), ('regex', 'regex'), ('iregex', 'contains (case insensitive)'), ('gt', 'greater than'), ('gte', 'greater than or equal to'), ('lt', 'less than'), ('lte', 'less than or equal to'), ('startswith', 'starts with'), ('endswith', 'starts with'), ('istartswith', 'ends with (case insensitive)'), ('iendswith', 'ends with (case insensitive)')], default='exact', max_length=12)),
                ('field_value', models.CharField(help_text='Can be anything from a number, to a string. Or, do `now-7 days`or `today+3 days` for fancy timedelta.', max_length=255)),
                ('drip', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='drip_rules', to='drip_marketing.Drip')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SentDrip',
            fields=[
                ('id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('from_email', models.EmailField(max_length=254)),
                ('sender_name', models.CharField(max_length=100)),
                ('subject', models.TextField()),
                ('text_body', models.TextField()),
                ('html_body', models.TextField()),
                ('state', models.CharField(choices=[('queued', 'Queued'), ('sent', 'Sent')], default='queued', max_length=20)),
                ('drip', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sent_drips', to='drip_marketing.Drip')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sent_drips', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
