# Generated by Django 4.2.4 on 2023-08-09 13:37

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


class Migration(migrations.Migration):
    # replaces = [
    #     ("users", "0012_user_local"),
    #     ("users", "0013_user_identity"),
    #     ("users", "0014_remove_user_identity_apidentity_user"),
    #     ("users", "0015_alter_apidentity_user"),
    # ]

    dependencies = [
        ("users", "0015_user_mastodon_last_reachable"),
        ("takahe", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="APIdentity",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("local", models.BooleanField()),
                ("username", models.CharField(blank=True, max_length=500, null=True)),
                (
                    "domain_name",
                    models.CharField(blank=True, max_length=500, null=True),
                ),
                ("deleted", models.DateTimeField(blank=True, null=True)),
                (
                    "user",
                    models.OneToOneField(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="identity",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "indexes": [
                    models.Index(
                        fields=["local", "username"],
                        name="users_apide_local_2d8170_idx",
                    ),
                    models.Index(
                        fields=["domain_name", "username"],
                        name="users_apide_domain__53ffa5_idx",
                    ),
                ],
            },
        ),
    ]
