# Generated by Django 6.0.1 on 2026-01-10 02:23

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Incidence',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('fingerprint', models.CharField(db_index=True, max_length=64, unique=True)),
                ('title', models.CharField(max_length=255)),
                ('occurrence_count', models.PositiveIntegerField(default=1)),
                ('first_seen', models.DateTimeField(auto_now_add=True)),
                ('last_seen', models.DateTimeField(auto_now=True)),
                ('status', models.CharField(choices=[('OPEN', 'Open'), ('RESOLVED', 'Resolved'), ('IGNORED', 'Ignored')], default='OPEN', max_length=20)),
                ('last_notified', models.DateTimeField(auto_now_add=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Footprint',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('request_id', models.CharField(blank=True, editable=False, help_text='Unique identifier for the request/response cycle.', max_length=36, null=True, unique=True)),
                ('request_user', models.CharField(default='anonymous', help_text="Authenticated user ID or 'anonymous'.", max_length=50)),
                ('request_path', models.CharField(max_length=255)),
                ('request_body', models.JSONField(blank=True, help_text='Parsed request body (e.g., POST/JSON data).', null=True)),
                ('request_method', models.CharField(blank=True, choices=[('get', 'Get'), ('post', 'Post'), ('put', 'Put'), ('patch', 'Patch'), ('delete', 'Delete')], max_length=20, null=True)),
                ('response_body', models.JSONField(blank=True, null=True)),
                ('response_time', models.FloatField(default=0.0, help_text='Total request to response duration in milliseconds (ms)')),
                ('status_code', models.IntegerField(default=200)),
                ('system_logs', models.JSONField(blank=True, help_text='Captured system logs (list of strings).', null=True)),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('user_agent', models.CharField(blank=True, max_length=512, null=True)),
                ('db_query_count', models.IntegerField(default=0, help_text='Total database connection queries.')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('exception_name', models.CharField(blank=True, max_length=255, null=True)),
                ('stack_trace', models.JSONField(blank=True, null=True)),
                ('incidence', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='insider.incidence')),
            ],
            options={
                'verbose_name': 'Footprint',
                'verbose_name_plural': 'Footprints',
            },
        ),
    ]
