# Generated by Django 5.2.6 on 2026-01-05 04:33

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


class Migration(migrations.Migration):

    dependencies = [
        ('user_activity', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='ClickEvent',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('page_path', models.CharField(blank=True, max_length=512, null=True)),
                ('element_text', models.CharField(blank=True, max_length=255, null=True)),
                ('element_type', models.CharField(blank=True, max_length=50, null=True)),
                ('timestamp', models.DateTimeField(auto_now_add=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DailyUserStats',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('date', models.DateField(blank=True, null=True, unique=True)),
                ('new_users', models.PositiveIntegerField(blank=True, null=True)),
                ('returning_users', models.PositiveIntegerField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VisitorModel',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('visiter_number', models.IntegerField()),
                ('session_id', models.CharField(max_length=255)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='VisitorSession',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('session_id', models.CharField(blank=True, max_length=255, null=True, unique=True)),
                ('is_bounce', models.BooleanField(blank=True, default=False, null=True)),
                ('started_at', models.DateTimeField(auto_now_add=True, null=True)),
                ('ended_at', models.DateTimeField(blank=True, null=True)),
                ('duration_seconds', models.PositiveIntegerField(blank=True, default=0, null=True)),
                ('visitor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='user_activity.visitormodel')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.DeleteModel(
            name='GeolocationCache',
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='entered_at',
            field=models.DateTimeField(auto_now_add=True, null=True),
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='exited_at',
            field=models.DateTimeField(blank=True, null=True),
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='is_new_user',
            field=models.BooleanField(default=True),
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='latitude',
            field=models.CharField(blank=True, max_length=64, null=True),
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='longitude',
            field=models.CharField(blank=True, max_length=64, null=True),
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='referrer',
            field=models.CharField(blank=True, max_length=512, null=True),
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='time_spent_seconds',
            field=models.PositiveIntegerField(blank=True, default=0, null=True),
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='visit_count',
            field=models.PositiveIntegerField(blank=True, default=1, null=True),
        ),
        migrations.AddField(
            model_name='clickevent',
            name='visitor',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='user_activity.visitormodel'),
        ),
        migrations.AddField(
            model_name='pagevisit',
            name='visitor',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='page_visits', to='user_activity.visitormodel'),
        ),
        migrations.AddField(
            model_name='clickevent',
            name='session',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='clicks', to='user_activity.visitorsession'),
        ),
    ]
