# Generated by Django 5.2.3 on 2025-07-13 03:14

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


class Migration(migrations.Migration):
    dependencies = [
        ("zerver", "0729_externalauthid"),
    ]

    operations = [
        migrations.CreateModel(
            name="PushDevice",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                (
                    "token_kind",
                    models.CharField(choices=[("apns", "APNs"), ("fcm", "FCM")], max_length=4),
                ),
                ("push_account_id", models.BigIntegerField()),
                ("push_public_key", models.TextField()),
                ("bouncer_device_id", models.BigIntegerField(null=True)),
                (
                    "error_code",
                    models.CharField(
                        choices=[
                            ("INVALID_BOUNCER_PUBLIC_KEY", "Invalid Bouncer Public Key"),
                            ("BAD_REQUEST", "Invalid Encrypted Push Registration"),
                            ("REQUEST_EXPIRED", "Request Expired"),
                        ],
                        max_length=100,
                        null=True,
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
                    ),
                ),
            ],
            options={
                "constraints": [
                    models.UniqueConstraint(
                        fields=("user", "push_account_id"),
                        name="unique_push_device_user_push_account_id",
                    )
                ],
            },
        ),
    ]
