<reponame>CreativeWurks/emailerpro
# Generated by Django 2.1 on 2018-08-12 20:58

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('campaigns', '0002_auto_20180812_2358'),
        ('lists', '0001_initial'),
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_type', models.PositiveSmallIntegerField(choices=[(1, 'Subscribed'), (2, 'Unsubscribed'), (3, 'Was sent'), (4, 'Opened'), (5, 'Clicked'), (6, 'Imported')], verbose_name='type')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='date')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True, unpack_ipv4=True, verbose_name='confirm IP address')),
                ('campaign', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='campaigns.Campaign')),
                ('email', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='campaigns.Email')),
                ('link', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='campaigns.Link')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='activities', to='core.City', verbose_name='location')),
            ],
            options={
                'verbose_name': 'activity',
                'verbose_name_plural': 'activities',
                'db_table': 'colossus_activities',
            },
        ),
        migrations.CreateModel(
            name='Subscriber',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('email', models.EmailField(max_length=255, verbose_name='email address')),
                ('name', models.CharField(blank=True, max_length=150, verbose_name='name')),
                ('open_rate', models.FloatField(default=0.0, editable=False, verbose_name='opens')),
                ('click_rate', models.FloatField(default=0.0, editable=False, verbose_name='clicks')),
                ('update_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='updated')),
                ('status', models.PositiveSmallIntegerField(choices=[(1, 'Pending'), (2, 'Subscribed'), (3, 'Unsubscribed'), (4, 'Cleaned')], default=1, verbose_name='status')),
                ('optin_ip_address', models.GenericIPAddressField(blank=True, null=True, unpack_ipv4=True, verbose_name='opt-in IP address')),
                ('optin_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='opt-in date')),
                ('confirm_ip_address', models.GenericIPAddressField(blank=True, null=True, unpack_ipv4=True, verbose_name='confirm IP address')),
                ('confirm_date', models.DateTimeField(blank=True, null=True, verbose_name='confirm date')),
                ('last_seen_ip_address', models.GenericIPAddressField(blank=True, null=True, unpack_ipv4=True, verbose_name='last seen IP address')),
                ('last_seen_date', models.DateTimeField(blank=True, null=True, verbose_name='last seen date')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='subscribers', to='core.City', verbose_name='location')),
                ('mailing_list', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='subscribers', to='lists.MailingList')),
            ],
            options={
                'verbose_name': 'subscriber',
                'verbose_name_plural': 'subscribers',
                'db_table': 'colossus_subscribers',
            },
        ),
        migrations.CreateModel(
            name='SubscriptionFormTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(choices=[('subscribe', 'Subscribe page'), ('subscribe-thank-you', 'Subscribe thank you page'), ('confirm-email', 'Opt-in confirm email'), ('confirm-thank-you', 'Opt-in confirm thank you page'), ('welcome-email', 'Final welcome email'), ('unsubscribe', 'Unsubscribe page'), ('unsubscribe-success', 'Unsubscribe success page'), ('goodbye-email', 'Goodbye email')], db_index=True, max_length=30, verbose_name='key')),
                ('redirect_url', models.URLField(blank=True, help_text='Instead of showing this page, redirect to URL.', verbose_name='redirect URL')),
                ('send_email', models.BooleanField(default=True, verbose_name='send final confirmation email?')),
                ('from_email', models.EmailField(max_length=254, verbose_name='from email address')),
                ('from_name', models.CharField(blank=True, max_length=100, verbose_name='from name')),
                ('subject', models.CharField(blank=True, max_length=150, verbose_name='email subject')),
                ('content_html', models.TextField(blank=True, verbose_name='content HTML')),
                ('content_text', models.TextField(blank=True, verbose_name='content plain text')),
                ('mailing_list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forms_templates', to='lists.MailingList', verbose_name='mailing list')),
            ],
            options={
                'verbose_name': 'form template',
                'verbose_name_plural': 'form templates',
                'db_table': 'colossus_form_templates',
            },
        ),
        migrations.AddField(
            model_name='activity',
            name='subscriber',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='subscribers.Subscriber'),
        ),
        migrations.AlterUniqueTogether(
            name='subscriber',
            unique_together={('email', 'mailing_list')},
        ),
    ]

# Generated by Django 2.1 on 2018-08-12 20:58

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('campaigns', '0002_auto_20180812_2358'),
        ('lists', '0001_initial'),
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('activity_type', models.PositiveSmallIntegerField(choices=[(1, 'Subscribed'), (2, 'Unsubscribed'), (3, 'Was sent'), (4, 'Opened'), (5, 'Clicked'), (6, 'Imported')], verbose_name='type')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='date')),
                ('description', models.TextField(blank=True, verbose_name='description')),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True, unpack_ipv4=True, verbose_name='confirm IP address')),
                ('campaign', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='campaigns.Campaign')),
                ('email', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='campaigns.Email')),
                ('link', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='campaigns.Link')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='activities', to='core.City', verbose_name='location')),
            ],
            options={
                'verbose_name': 'activity',
                'verbose_name_plural': 'activities',
                'db_table': 'colossus_activities',
            },
        ),
        migrations.CreateModel(
            name='Subscriber',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('email', models.EmailField(max_length=255, verbose_name='email address')),
                ('name', models.CharField(blank=True, max_length=150, verbose_name='name')),
                ('open_rate', models.FloatField(default=0.0, editable=False, verbose_name='opens')),
                ('click_rate', models.FloatField(default=0.0, editable=False, verbose_name='clicks')),
                ('update_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='updated')),
                ('status', models.PositiveSmallIntegerField(choices=[(1, 'Pending'), (2, 'Subscribed'), (3, 'Unsubscribed'), (4, 'Cleaned')], default=1, verbose_name='status')),
                ('optin_ip_address', models.GenericIPAddressField(blank=True, null=True, unpack_ipv4=True, verbose_name='opt-in IP address')),
                ('optin_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='opt-in date')),
                ('confirm_ip_address', models.GenericIPAddressField(blank=True, null=True, unpack_ipv4=True, verbose_name='confirm IP address')),
                ('confirm_date', models.DateTimeField(blank=True, null=True, verbose_name='confirm date')),
                ('last_seen_ip_address', models.GenericIPAddressField(blank=True, null=True, unpack_ipv4=True, verbose_name='last seen IP address')),
                ('last_seen_date', models.DateTimeField(blank=True, null=True, verbose_name='last seen date')),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='subscribers', to='core.City', verbose_name='location')),
                ('mailing_list', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='subscribers', to='lists.MailingList')),
            ],
            options={
                'verbose_name': 'subscriber',
                'verbose_name_plural': 'subscribers',
                'db_table': 'colossus_subscribers',
            },
        ),
        migrations.CreateModel(
            name='SubscriptionFormTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(choices=[('subscribe', 'Subscribe page'), ('subscribe-thank-you', 'Subscribe thank you page'), ('confirm-email', 'Opt-in confirm email'), ('confirm-thank-you', 'Opt-in confirm thank you page'), ('welcome-email', 'Final welcome email'), ('unsubscribe', 'Unsubscribe page'), ('unsubscribe-success', 'Unsubscribe success page'), ('goodbye-email', 'Goodbye email')], db_index=True, max_length=30, verbose_name='key')),
                ('redirect_url', models.URLField(blank=True, help_text='Instead of showing this page, redirect to URL.', verbose_name='redirect URL')),
                ('send_email', models.BooleanField(default=True, verbose_name='send final confirmation email?')),
                ('from_email', models.EmailField(max_length=254, verbose_name='from email address')),
                ('from_name', models.CharField(blank=True, max_length=100, verbose_name='from name')),
                ('subject', models.CharField(blank=True, max_length=150, verbose_name='email subject')),
                ('content_html', models.TextField(blank=True, verbose_name='content HTML')),
                ('content_text', models.TextField(blank=True, verbose_name='content plain text')),
                ('mailing_list', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='forms_templates', to='lists.MailingList', verbose_name='mailing list')),
            ],
            options={
                'verbose_name': 'form template',
                'verbose_name_plural': 'form templates',
                'db_table': 'colossus_form_templates',
            },
        ),
        migrations.AddField(
            model_name='activity',
            name='subscriber',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='activities', to='subscribers.Subscriber'),
        ),
        migrations.AlterUniqueTogether(
            name='subscriber',
            unique_together={('email', 'mailing_list')},
        ),
    ]
# Generated by Django 2.1 on 2018-08-12 20:58