# Generated by Django 4.1.7 on 2023-09-18 17:48

from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Metric",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("key", models.CharField(max_length=255)),
                ("value", models.DecimalField(decimal_places=4, max_digits=10)),
                ("dimensions", models.JSONField(default=list)),
                (
                    "dimensions_hash",
                    models.CharField(max_length=255, null=True),
                ),
                (
                    "unit",
                    models.CharField(
                        choices=[
                            (10, "Seconds"),
                            (20, "Count/Second"),
                            (30, "None"),
                        ],
                        max_length=255,
                    ),
                ),
            ],
        ),
        migrations.AddIndex(
            model_name="metric",
            index=models.Index(fields=["key"], name="metrics_key_9782fc_idx"),
        ),
        migrations.AddConstraint(
            model_name="metric",
            constraint=models.UniqueConstraint(
                fields=("key", "dimensions_hash"), name="unique_metric"
            ),
        ),
    ]
