# Generated by Django 5.0.3 on 2024-03-26 15:12

import django.db.models.deletion
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="SonarRequest",
            fields=[
                (
                    "uuid",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("verb", models.CharField(max_length=255, verbose_name="Verb")),
                ("path", models.CharField(max_length=255, verbose_name="Path")),
                ("status", models.CharField(max_length=255, verbose_name="Status")),
                ("duration", models.IntegerField(verbose_name="Duration")),
                (
                    "ip_address",
                    models.GenericIPAddressField(
                        blank=True, null=True, verbose_name="IP Address"
                    ),
                ),
                (
                    "hostname",
                    models.CharField(
                        blank=True, max_length=255, null=True, verbose_name="Hostname"
                    ),
                ),
                ("is_ajax", models.BooleanField(default=False, verbose_name="Ajax")),
                ("is_read", models.BooleanField(default=False, verbose_name="Read")),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="Created"),
                ),
            ],
            options={
                "db_table": "sonar_requests",
            },
        ),
        migrations.CreateModel(
            name="SonarData",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("category", models.CharField(max_length=255, verbose_name="Category")),
                ("data", models.JSONField(verbose_name="Data")),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="Created"),
                ),
                (
                    "sonar_request",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="django_sonar.sonarrequest",
                        verbose_name="Request UUID",
                    ),
                ),
            ],
            options={
                "db_table": "sonar_data",
            },
        ),
    ]
