# Generated by Django 5.2.9 on 2025-12-03 17:40

import django.db.models.deletion
import django_cfg.apps.integrations.grpc.models.grpc_api_key
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("grpc", "0006_grpcrequestlog_api_key_and_more"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.RemoveIndex(
            model_name="grpcapikey",
            name="django_cfg__expires_8f83cf_idx",
        ),
        migrations.RemoveIndex(
            model_name="grpcapikey",
            name="django_cfg__key_typ_6ad1cb_idx",
        ),
        migrations.RemoveIndex(
            model_name="grpcrequestlog",
            name="django_cfg__method__5e704d_idx",
        ),
        migrations.RemoveIndex(
            model_name="grpcrequestlog",
            name="django_cfg__user_id_f2ada7_idx",
        ),
        migrations.RemoveIndex(
            model_name="grpcrequestlog",
            name="django_cfg__grpc_st_fea09f_idx",
        ),
        migrations.RemoveIndex(
            model_name="grpcrequestlog",
            name="django_cfg__api_key_218ecc_idx",
        ),
        migrations.RemoveIndex(
            model_name="grpcserverstatus",
            name="django_cfg__address_4966eb_idx",
        ),
        migrations.RemoveIndex(
            model_name="grpcserverstatus",
            name="django_cfg__pid_bab561_idx",
        ),
        migrations.RemoveField(
            model_name="grpcapikey",
            name="created_by",
        ),
        migrations.RemoveField(
            model_name="grpcapikey",
            name="key_type",
        ),
        migrations.RemoveField(
            model_name="grpcrequestlog",
            name="error_details",
        ),
        migrations.RemoveField(
            model_name="grpcrequestlog",
            name="peer",
        ),
        migrations.RemoveField(
            model_name="grpcrequestlog",
            name="request_data",
        ),
        migrations.RemoveField(
            model_name="grpcrequestlog",
            name="request_size",
        ),
        migrations.RemoveField(
            model_name="grpcrequestlog",
            name="response_data",
        ),
        migrations.RemoveField(
            model_name="grpcrequestlog",
            name="response_size",
        ),
        migrations.RemoveField(
            model_name="grpcrequestlog",
            name="user_agent",
        ),
        migrations.RemoveField(
            model_name="grpcserverstatus",
            name="created_at",
        ),
        migrations.RemoveField(
            model_name="grpcserverstatus",
            name="enable_health_check",
        ),
        migrations.RemoveField(
            model_name="grpcserverstatus",
            name="enable_reflection",
        ),
        migrations.RemoveField(
            model_name="grpcserverstatus",
            name="max_workers",
        ),
        migrations.RemoveField(
            model_name="grpcserverstatus",
            name="registered_services",
        ),
        migrations.RemoveField(
            model_name="grpcserverstatus",
            name="updated_at",
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="created_at",
            field=models.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="description",
            field=models.TextField(blank=True),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="expires_at",
            field=models.DateTimeField(
                blank=True, db_index=True, help_text="Null = never expires", null=True
            ),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="is_active",
            field=models.BooleanField(db_index=True, default=True),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="key",
            field=models.CharField(
                db_index=True,
                default=django_cfg.apps.integrations.grpc.models.grpc_api_key.generate_api_key,
                max_length=64,
                unique=True,
            ),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="last_used_at",
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="name",
            field=models.CharField(
                help_text="Descriptive name (e.g., 'Bot Service')", max_length=255
            ),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="request_count",
            field=models.IntegerField(default=0),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="updated_at",
            field=models.DateTimeField(auto_now=True),
        ),
        migrations.AlterField(
            model_name="grpcapikey",
            name="user",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="grpc_api_keys",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="api_key",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="request_logs",
                to="grpc.grpcapikey",
            ),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="client_ip",
            field=models.GenericIPAddressField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="completed_at",
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="created_at",
            field=models.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="duration_ms",
            field=models.IntegerField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="error_message",
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="full_method",
            field=models.CharField(db_index=True, max_length=400),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="grpc_status_code",
            field=models.CharField(blank=True, db_index=True, max_length=50, null=True),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="is_authenticated",
            field=models.BooleanField(db_index=True, default=False),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="method_name",
            field=models.CharField(db_index=True, max_length=200),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="request_id",
            field=models.CharField(db_index=True, max_length=100, unique=True),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="service_name",
            field=models.CharField(db_index=True, max_length=200),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="status",
            field=models.CharField(
                choices=[
                    ("success", "Success"),
                    ("error", "Error"),
                    ("cancelled", "Cancelled"),
                    ("timeout", "Timeout"),
                ],
                db_index=True,
                default="success",
                max_length=20,
            ),
        ),
        migrations.AlterField(
            model_name="grpcrequestlog",
            name="user",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="grpc_request_logs",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="address",
            field=models.CharField(db_index=True, max_length=200),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="error_message",
            field=models.TextField(blank=True, null=True),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="host",
            field=models.CharField(max_length=200),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="hostname",
            field=models.CharField(max_length=255),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="instance_id",
            field=models.CharField(db_index=True, max_length=100, unique=True),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="last_heartbeat",
            field=models.DateTimeField(auto_now=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="pid",
            field=models.IntegerField(),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="port",
            field=models.IntegerField(),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="started_at",
            field=models.DateTimeField(auto_now_add=True, db_index=True),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="status",
            field=models.CharField(
                choices=[
                    ("starting", "Starting"),
                    ("running", "Running"),
                    ("stopping", "Stopping"),
                    ("stopped", "Stopped"),
                    ("error", "Error"),
                ],
                db_index=True,
                default="starting",
                max_length=20,
            ),
        ),
        migrations.AlterField(
            model_name="grpcserverstatus",
            name="stopped_at",
            field=models.DateTimeField(blank=True, null=True),
        ),
    ]
