# Generated by Django 5.0 on 2026-07-25 01:15

import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('public', '0005_emailmessage'),
    ]

    operations = [
        migrations.AddField(
            model_name='contact',
            name='utm_campaign',
            field=models.CharField(blank=True, default='', max_length=255),
        ),
        migrations.AddField(
            model_name='contact',
            name='utm_content',
            field=models.CharField(blank=True, default='', max_length=255),
        ),
        migrations.AddField(
            model_name='contact',
            name='utm_medium',
            field=models.CharField(blank=True, default='', max_length=255),
        ),
        migrations.AddField(
            model_name='contact',
            name='utm_source',
            field=models.CharField(blank=True, default='', max_length=255),
        ),
        migrations.AddField(
            model_name='contact',
            name='utm_term',
            field=models.CharField(blank=True, default='', max_length=255),
        ),
        migrations.CreateModel(
            name='PageVisit',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(db_index=True, default=django.utils.timezone.now)),
                ('path', models.CharField(db_index=True, max_length=512)),
                ('query_string', models.CharField(blank=True, default='', max_length=1024)),
                ('referrer', models.URLField(blank=True, default='', max_length=1024)),
                ('user_agent', models.CharField(blank=True, default='', max_length=512)),
                ('traffic_type', models.CharField(choices=[('human', 'Human traffic'), ('ai_bot', 'AI bot / AI search'), ('search_indexer', 'Search indexing'), ('social_bot', 'Social / preview bot'), ('monitoring', 'Monitoring / uptime'), ('other_bot', 'Other bot'), ('unknown', 'Unknown')], db_index=True, default='unknown', max_length=32)),
                ('utm_source', models.CharField(blank=True, db_index=True, default='', max_length=255)),
                ('utm_medium', models.CharField(blank=True, db_index=True, default='', max_length=255)),
                ('utm_campaign', models.CharField(blank=True, db_index=True, default='', max_length=255)),
                ('utm_term', models.CharField(blank=True, default='', max_length=255)),
                ('utm_content', models.CharField(blank=True, default='', max_length=255)),
                ('session_key', models.CharField(blank=True, db_index=True, default='', max_length=64)),
                ('is_landing', models.BooleanField(default=False, help_text='True when this request carried UTM params (campaign landing).')),
            ],
            options={
                'ordering': ['-created'],
                'indexes': [models.Index(fields=['-created', 'traffic_type'], name='public_page_created_8c59a5_idx'), models.Index(fields=['utm_source', 'utm_campaign'], name='public_page_utm_sou_96ed78_idx')],
            },
        ),
    ]
