# Generated by Django 4.2.11 on 2024-05-09 10:54

import django.db.models.deletion
import django.db.models.functions.text
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models

import account.models


class Migration(migrations.Migration):
    replaces = [
        ("account", "0001_initial"),
        ("account", "0002_remove_first_last_name"),
        ("account", "0003_alter_katuser_full_name"),
        ("account", "0004_authtoken_authtoken_unique_name"),
    ]

    initial = True

    dependencies = [("auth", "0012_alter_user_first_name_max_length")]

    operations = [
        migrations.CreateModel(
            name="KATUser",
            fields=[
                ("password", models.CharField(max_length=128, verbose_name="password")),
                ("last_login", models.DateTimeField(blank=True, null=True, verbose_name="last login")),
                (
                    "is_superuser",
                    models.BooleanField(
                        default=False,
                        help_text="Designates that this user has all permissions without explicitly assigning them.",
                        verbose_name="superuser status",
                    ),
                ),
                ("id", models.AutoField(primary_key=True, serialize=False, verbose_name="ID")),
                ("full_name", models.CharField(max_length=150, verbose_name="full name")),
                ("email", account.models.LowercaseEmailField(max_length=254, unique=True, verbose_name="email")),
                (
                    "is_staff",
                    models.BooleanField(
                        default=False,
                        help_text="Designates whether the user can log into this admin site.",
                        verbose_name="staff status",
                    ),
                ),
                (
                    "is_active",
                    models.BooleanField(
                        default=True,
                        help_text="Designates whether this user should be treated as active. Unselect this instead of deleting accounts.",
                        verbose_name="active",
                    ),
                ),
                ("date_joined", models.DateTimeField(default=django.utils.timezone.now, verbose_name="date joined")),
                (
                    "groups",
                    models.ManyToManyField(
                        blank=True,
                        help_text="The groups this user belongs to. A user will get all permissions granted to each of their groups.",
                        related_name="user_set",
                        related_query_name="user",
                        to="auth.group",
                        verbose_name="groups",
                    ),
                ),
                (
                    "user_permissions",
                    models.ManyToManyField(
                        blank=True,
                        help_text="Specific permissions for this user.",
                        related_name="user_set",
                        related_query_name="user",
                        to="auth.permission",
                        verbose_name="user permissions",
                    ),
                ),
            ],
            options={"abstract": False},
        ),
        migrations.CreateModel(
            name="AuthToken",
            fields=[
                ("digest", models.CharField(max_length=128, primary_key=True, serialize=False)),
                ("token_key", models.CharField(db_index=True, max_length=25)),
                ("created", models.DateTimeField(auto_now_add=True)),
                ("expiry", models.DateTimeField(blank=True, null=True)),
                ("name", models.CharField(max_length=150, verbose_name="name")),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="auth_token_set",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.AddConstraint(
            model_name="authtoken",
            constraint=models.UniqueConstraint(
                models.F("user"), django.db.models.functions.text.Lower("name"), name="unique name"
            ),
        ),
    ]
