# Generated by Django 5.2.8 on 2026-01-13 00:44

import django.utils.timezone
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

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

    operations = [
        migrations.CreateModel(
            name="ClerkUser",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("password", models.CharField(max_length=128, verbose_name="password")),
                (
                    "is_superuser",
                    models.BooleanField(
                        default=False,
                        help_text="Designates that this user has all permissions without explicitly assigning them.",
                        verbose_name="superuser status",
                    ),
                ),
                (
                    "uid",
                    models.UUIDField(
                        db_index=True,
                        default=uuid.uuid4,
                        editable=False,
                        help_text="Public unique identifier for the user.",
                    ),
                ),
                (
                    "clerk_id",
                    models.CharField(
                        db_index=True,
                        help_text="Unique identifier from Clerk.",
                        max_length=255,
                        unique=True,
                    ),
                ),
                (
                    "email",
                    models.EmailField(
                        db_index=True,
                        help_text="User's email address.",
                        max_length=254,
                        unique=True,
                    ),
                ),
                (
                    "first_name",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="User's first name.",
                        max_length=255,
                    ),
                ),
                (
                    "last_name",
                    models.CharField(
                        blank=True,
                        default="",
                        help_text="User's last name.",
                        max_length=255,
                    ),
                ),
                (
                    "image_url",
                    models.URLField(
                        blank=True,
                        default="",
                        help_text="URL to user's profile image from Clerk.",
                        max_length=500,
                    ),
                ),
                (
                    "is_active",
                    models.BooleanField(
                        default=True, help_text="Whether the user account is active."
                    ),
                ),
                (
                    "is_staff",
                    models.BooleanField(
                        default=False,
                        help_text="Whether the user can access the admin site.",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        help_text="When the user was created.",
                    ),
                ),
                (
                    "updated_at",
                    models.DateTimeField(
                        auto_now=True, help_text="When the user was last updated."
                    ),
                ),
                (
                    "last_login",
                    models.DateTimeField(
                        blank=True,
                        help_text="Last login timestamp (managed by Clerk).",
                        null=True,
                    ),
                ),
                (
                    "last_logout",
                    models.DateTimeField(
                        blank=True,
                        help_text="Last logout timestamp (managed by Clerk).",
                        null=True,
                    ),
                ),
                (
                    "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={
                "verbose_name": "Clerk User",
                "verbose_name_plural": "Clerk Users",
                "ordering": ["-created_at"],
                "abstract": False,
                "swappable": "AUTH_USER_MODEL",
                "indexes": [
                    models.Index(
                        fields=["clerk_id"], name="django_cler_clerk_i_d591b6_idx"
                    ),
                    models.Index(fields=["email"], name="django_cler_email_f1e649_idx"),
                    models.Index(fields=["uid"], name="django_cler_uid_9f6a95_idx"),
                    models.Index(
                        fields=["is_active"], name="django_cler_is_acti_ceff9c_idx"
                    ),
                ],
            },
        ),
    ]
