Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

4.0 KB
Raw Blame
# Generated by Django 4.2.27 on 2026-01-29 15:47

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

import posthog.models.utils


class Migration(migrations.Migration):
    initial = True

    dependencies = [
        ("ee", "0037_add_conversation_approval_decisions"),
        ("posthog", "0993_approvalpolicy_bypass_options"),
    ]

    operations = [
        migrations.CreateModel(
            name="SignalReport",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=posthog.models.utils.uuid7,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("potential", "Potential"),
                            ("candidate", "Candidate"),
                            ("in_progress", "In Progress"),
                            ("ready", "Ready"),
                            ("failed", "Failed"),
                        ],
                        default="potential",
                        max_length=20,
                    ),
                ),
                ("total_weight", models.FloatField(default=0.0)),
                ("signal_count", models.IntegerField(default=0)),
                ("signals_at_run", models.IntegerField(default=0)),
                ("title", models.TextField(blank=True, null=True)),
                ("summary", models.TextField(blank=True, null=True)),
                ("error", models.TextField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("promoted_at", models.DateTimeField(blank=True, null=True)),
                ("last_run_at", models.DateTimeField(blank=True, null=True)),
                (
                    "conversation",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="ee.conversation",
                    ),
                ),
                (
                    "team",
                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="posthog.team"),
                ),
            ],
        ),
        migrations.CreateModel(
            name="SignalReportArtefact",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=posthog.models.utils.uuid7,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("type", models.CharField(max_length=100)),
                ("content", models.BinaryField()),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "report",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="artefacts",
                        to="signals.signalreport",
                    ),
                ),
                (
                    "team",
                    models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to="posthog.team"),
                ),
            ],
            options={
                "abstract": False,
            },
        ),
        migrations.AddIndex(
            model_name="signalreport",
            index=models.Index(
                fields=["team", "status", "promoted_at"],
                name="signals_sig_team_id_9cf061_idx",
            ),
        ),
        migrations.AddIndex(
            model_name="signalreport",
            index=models.Index(fields=["team", "created_at"], name="signals_sig_team_id_84c1a8_idx"),
        ),
    ]