# Generated by Django 2.0.2 on 2019-04-01 22:26

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='AvailableDomains',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('domain', models.CharField(max_length=80, validators=[django.core.validators.RegexValidator('[\\w-]+(\\.[\\w-]+)+\\.?', 'Ваш домен должен быть вида google.com')], verbose_name='Домен')),
            ],
            options={
                'verbose_name': 'Разрешенный домен',
                'verbose_name_plural': 'Разрешенные домены',
            },
        ),
        migrations.CreateModel(
            name='VerificationCode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.SmallIntegerField(choices=[(1, 'Регистрация'), (2, 'Восстановление')], default=1, verbose_name='Тип')),
                ('code', models.CharField(max_length=64, verbose_name='Код')),
                ('expired', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Время протухания')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='codes', to=settings.AUTH_USER_MODEL, verbose_name='Пользователь')),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='verificationcode',
            unique_together={('type', 'user')},
        ),
    ]
