# Generated by Django 4.2.11 on 2024-04-25 11:48

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("projectroles", "0028_populate_finder_role"),
    ]

    operations = [
        migrations.CreateModel(
            name="SODARUserAdditionalEmail",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("email", models.EmailField(help_text="Email address", max_length=254)),
                (
                    "verified",
                    models.BooleanField(
                        default=False, help_text="Email verification status"
                    ),
                ),
                (
                    "secret",
                    models.CharField(
                        help_text="Secret token for email verification",
                        max_length=255,
                        unique=True,
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        auto_now_add=True, help_text="DateTime of creation"
                    ),
                ),
                (
                    "date_modified",
                    models.DateTimeField(
                        auto_now=True, help_text="DateTime of last modification"
                    ),
                ),
                (
                    "sodar_uuid",
                    models.UUIDField(
                        default=uuid.uuid4,
                        help_text="SODARUserAdditionalEmail SODAR UUID",
                        unique=True,
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        help_text="User for whom the email is assigned",
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="additional_emails",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["user__username", "email"],
                "unique_together": {("user", "email")},
            },
        ),
    ]
