# Generated by Django 5.2.6 on 2025-12-29 05:20

import django.db.models.deletion
import django.utils.timezone
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='SessionConsentModel',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('session_id', models.CharField(max_length=255, unique=True)),
                ('accept_all_consent_received', models.BooleanField(default=False)),
                ('essential_only_consent_received', models.BooleanField(default=False)),
                ('received_on', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='GeolocationCache',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('ip_address', models.CharField(max_length=45, unique=True)),
                ('location', models.CharField(max_length=255)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('request_count', models.PositiveIntegerField(default=0)),
            ],
            options={
                'indexes': [models.Index(fields=['ip_address'], name='user_activi_ip_addr_664fe3_idx')],
            },
        ),
        migrations.CreateModel(
            name='PageVisit',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('session_id', models.CharField(max_length=255)),
                ('url', models.CharField(max_length=255)),
                ('ip_address', models.CharField(max_length=45)),
                ('query_params', models.TextField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('path', models.CharField(max_length=512)),
                ('user_agent', models.TextField(blank=True, null=True)),
                ('session_data', models.JSONField(blank=True, default=dict, null=True)),
                ('location', models.CharField(blank=True, max_length=64, null=True)),
                ('country', models.CharField(blank=True, max_length=64, null=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-timestamp'],
                'indexes': [models.Index(fields=['session_id', 'timestamp'], name='user_activi_session_a322d8_idx')],
            },
        ),
    ]
