# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-01-21 09:48
from __future__ import unicode_literals

import functools

import django.db.models.deletion
import django.utils.crypto
import django_cryptography.fields
import django_extensions.db.fields
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='VerificationCode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                (
                    'created',
                    django_extensions.db.fields.CreationDateTimeField(
                        auto_now_add=True, null=True, verbose_name='created'
                    ),
                ),
                (
                    'modified',
                    django_extensions.db.fields.ModificationDateTimeField(
                        auto_now=True, null=True, verbose_name='modified'
                    ),
                ),
                (
                    'code',
                    django_cryptography.fields.encrypt(
                        models.CharField(
                            default=functools.partial(
                                django.utils.crypto.get_random_string,
                                *(),
                                **{'allowed_chars': '0123456789', 'length': 5},
                            ),
                            max_length=128,
                        )
                    ),
                ),
                (
                    'date_verified',
                    models.DateField(
                        blank=True,
                        help_text='Designates whether this user has verified the code',
                        null=True,
                        verbose_name='verified',
                    ),
                ),
                (
                    'user',
                    models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
                ),
            ],
            options={
                'ordering': ['-created'],
            },
        ),
    ]
