# Generated by Django 5.2.3 on 2025-07-08 00:35

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


class Migration(migrations.Migration):
    dependencies = [
        ("zerver", "0728_alter_stream_can_resolve_topics_group"),
    ]

    operations = [
        migrations.CreateModel(
            name="ExternalAuthID",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("date_created", models.DateTimeField(default=django.utils.timezone.now)),
                ("external_auth_method_name", models.TextField()),
                ("external_auth_id", models.TextField()),
                (
                    "realm",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="zerver.realm"
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
                    ),
                ),
            ],
            options={
                "constraints": [
                    models.UniqueConstraint(
                        fields=("realm", "external_auth_method_name", "external_auth_id"),
                        name="zerver_externalauthid_uniq",
                    )
                ],
            },
        ),
    ]
