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.

1.7 KB
Raw Blame
# Generated by Django 4.2.29 on 2026-04-20 08:33

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

import posthog.models.utils


class Migration(migrations.Migration):
    dependencies = [
        ("logs", "0003_alter_logsalertconfiguration_state"),
    ]

    operations = [
        migrations.CreateModel(
            name="LogsAlertEvent",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=posthog.models.utils.uuid7,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("result_count", models.PositiveIntegerField(blank=True, null=True)),
                ("threshold_breached", models.BooleanField()),
                ("state_before", models.CharField(max_length=20)),
                ("state_after", models.CharField(max_length=20)),
                ("error_message", models.TextField(blank=True, null=True)),
                (
                    "query_duration_ms",
                    models.PositiveIntegerField(blank=True, null=True),
                ),
                (
                    "alert",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="events",
                        to="logs.logsalertconfiguration",
                    ),
                ),
            ],
            options={
                "db_table": "logs_logsalertevent",
            },
        ),
    ]