# Generated by Django 6.0 on 2025-12-09 12:44

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("djinsight", "0004_v2_new_architecture"),
    ]

    operations = [
        migrations.CreateModel(
            name="MCPAPIKey",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "key",
                    models.CharField(
                        max_length=64, unique=True, verbose_name="API Key"
                    ),
                ),
                ("name", models.CharField(max_length=200, verbose_name="Name")),
                (
                    "description",
                    models.TextField(blank=True, verbose_name="Description"),
                ),
                ("is_active", models.BooleanField(default=True, verbose_name="Active")),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="Created At"),
                ),
                (
                    "last_used_at",
                    models.DateTimeField(
                        blank=True, null=True, verbose_name="Last Used At"
                    ),
                ),
            ],
            options={
                "verbose_name": "MCP API Key",
                "verbose_name_plural": "MCP API Keys",
            },
        ),
        migrations.RemoveIndex(
            model_name="pageviewlog",
            name="djinsight_p_page_id_f86134_idx",
        ),
        migrations.RemoveIndex(
            model_name="pageviewlog",
            name="djinsight_p_content_4f4405_idx",
        ),
        migrations.RemoveIndex(
            model_name="pageviewlog",
            name="djinsight_p_session_54f5b5_idx",
        ),
        migrations.RemoveIndex(
            model_name="pageviewlog",
            name="djinsight_p_timesta_9736c6_idx",
        ),
        migrations.DeleteModel(
            name="PageViewLog",
        ),
        migrations.AlterModelOptions(
            name="pageviewstatistics",
            options={
                "verbose_name": "Page View Statistics",
                "verbose_name_plural": "Page View Statistics",
            },
        ),
        migrations.RemoveIndex(
            model_name="pageviewsummary",
            name="djinsight_p_page_id_efa5ff_idx",
        ),
        migrations.RenameIndex(
            model_name="contenttyperegistry",
            new_name="djinsight_c_content_6272ec_idx",
            old_name="djinsight_c_content_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewevent",
            new_name="djinsight_p_content_2dc625_idx",
            old_name="djinsight_p_content_obj_tim_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewevent",
            new_name="djinsight_p_session_8f6dd6_idx",
            old_name="djinsight_p_session_con_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewevent",
            new_name="djinsight_p_timesta_684154_idx",
            old_name="djinsight_p_timesta_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewevent",
            new_name="djinsight_p_content_bb1ec0_idx",
            old_name="djinsight_p_content_tim_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewstatistics",
            new_name="djinsight_p_content_5a1d84_idx",
            old_name="djinsight_p_content_obj_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewstatistics",
            new_name="djinsight_p_content_8a4fc3_idx",
            old_name="djinsight_p_content_tot_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewstatistics",
            new_name="djinsight_p_content_943b3e_idx",
            old_name="djinsight_p_content_uni_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewstatistics",
            new_name="djinsight_p_last_vi_195672_idx",
            old_name="djinsight_p_last_vi_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewstatistics",
            new_name="djinsight_p_updated_d991b2_idx",
            old_name="djinsight_p_updated_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewsummary",
            new_name="djinsight_p_content_8d9111_idx",
            old_name="djinsight_p_content_obj_dat_idx",
        ),
        migrations.RenameIndex(
            model_name="pageviewsummary",
            new_name="djinsight_p_content_cc7390_idx",
            old_name="djinsight_p_content_912dc8_idx",
        ),
        migrations.AlterField(
            model_name="pageviewsummary",
            name="date",
            field=models.DateField(db_index=True, verbose_name="Date"),
        ),
        migrations.AlterField(
            model_name="pageviewsummary",
            name="object_id",
            field=models.PositiveIntegerField(),
        ),
        migrations.AlterField(
            model_name="pageviewsummary",
            name="total_views",
            field=models.PositiveIntegerField(default=0, verbose_name="Total Views"),
        ),
        migrations.AlterField(
            model_name="pageviewsummary",
            name="unique_views",
            field=models.PositiveIntegerField(default=0, verbose_name="Unique Views"),
        ),
        migrations.AddIndex(
            model_name="mcpapikey",
            index=models.Index(
                fields=["key", "is_active"], name="djinsight_m_key_74ae77_idx"
            ),
        ),
    ]
