# Generated by Django 2.2.2 on 2019-08-02 19:32

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="EmailAddress",
            fields=[
                (
                    "address",
                    models.EmailField(
                        db_index=True,
                        help_text="The user's preferred spelling of their email address.",
                        max_length=254,
                        verbose_name="address",
                    ),
                ),
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        help_text="A unique identifier for the instance.",
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "is_verified",
                    models.BooleanField(
                        default=False,
                        help_text="A boolean indicating if the user has confirmed ownership of the address.",
                    ),
                ),
                (
                    "normalized_address",
                    models.EmailField(
                        help_text="The normalized version of the user's email address used for comparison with other addresses.",
                        max_length=254,
                        unique=True,
                        verbose_name="normalized address",
                    ),
                ),
                (
                    "time_created",
                    models.DateTimeField(
                        auto_now_add=True,
                        help_text="The time that the instance was created.",
                        verbose_name="creation time",
                    ),
                ),
                (
                    "time_updated",
                    models.DateTimeField(
                        auto_now=True,
                        help_text="The time of the last update to the instance.",
                        verbose_name="last update time",
                    ),
                ),
                (
                    "time_verified",
                    models.DateTimeField(
                        blank=True,
                        help_text="The time that the user verified ownership of this email address.",
                        null=True,
                        verbose_name="verification time",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        help_text="The user who owns the email address.",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="email_addresses",
                        related_query_name="email_address",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="user",
                    ),
                ),
            ],
            options={
                "verbose_name": "email address",
                "verbose_name_plural": "email addresses",
                "ordering": ("normalized_address",),
            },
        )
    ]
