# Generated by Django 2.2.5 on 2019-09-11 10:23

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(max_length=255)),
                ('message', models.TextField(validators=[email_notifications.validators.validate_unsubscribe_link])),
                ('html_message', models.TextField(blank=True, null=True, validators=[email_notifications.validators.validate_unsubscribe_link])),
                ('create_at', models.DateTimeField(auto_now_add=True)),
                ('status', models.IntegerField(choices=[(0, 'fail'), (1, 'undone'), (2, 'success')], default=1)),
                ('finish_at', models.DateTimeField(blank=True, null=True)),
                ('users', models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Status',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(choices=[(0, 'subscribe'), (1, 'unsubscribe')], default=0)),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'status',
                'verbose_name_plural': 'status',
                'unique_together': {('user', 'uuid')},
            },
        ),
    ]
