# Generated by Plain 0.52.2 on 2025-07-08 01:17

import uuid

from plain import models
from plain.models import migrations


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Pageview",
            fields=[
                ("id", models.PrimaryKeyField()),
                ("uuid", models.UUIDField(default=uuid.uuid4)),
                ("url", models.URLField(max_length=768)),
                ("timestamp", models.DateTimeField(auto_now_add=True)),
                ("title", models.CharField(max_length=512, required=False)),
                ("referrer", models.CharField(max_length=1024, required=False)),
                ("user_id", models.CharField(max_length=255, required=False)),
                ("session_key", models.CharField(max_length=255, required=False)),
            ],
            options={
                "ordering": ["-timestamp"],
            },
        ),
        migrations.AddIndex(
            model_name="pageview",
            index=models.Index(
                fields=["timestamp"], name="plainpagevi_timesta_da4eb2_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="pageview",
            index=models.Index(
                fields=["user_id"], name="plainpagevi_user_id_b40ca5_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="pageview",
            index=models.Index(
                fields=["session_key"], name="plainpagevi_session_5545cf_idx"
            ),
        ),
        migrations.AddIndex(
            model_name="pageview",
            index=models.Index(fields=["url"], name="plainpagevi_url_d3e821_idx"),
        ),
        migrations.AddConstraint(
            model_name="pageview",
            constraint=models.UniqueConstraint(
                fields=("uuid",), name="plainpageviews_pageview_unique_uuid"
            ),
        ),
    ]
