# Generated by Django 4.2.9 on 2024-01-04 23:21

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("django_admin_keycloak", "0004_delete_keycloaksession"),
    ]

    operations = [
        migrations.CreateModel(
            name="KeycloakSession",
            fields=[
                (
                    "sid",
                    models.UUIDField(
                        editable=False,
                        primary_key=True,
                        serialize=False,
                        verbose_name="SID",
                    ),
                ),
                (
                    "django_session_key",
                    models.CharField(max_length=40, verbose_name="session key"),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="created at"),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, verbose_name="updated at"),
                ),
                (
                    "provider",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sessions",
                        to="django_admin_keycloak.keycloakprovider",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="sso_sessions",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Keycloak Session",
                "verbose_name_plural": "Keycloak Sessions",
                "db_table": "keycloak_session",
            },
        ),
    ]
