# Generated by Django 5.2.10 on 2026-01-24 00:46

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


class Migration(migrations.Migration):

    dependencies = [
        ("sensors", "0002_thermometer_sampling_interval_seconds"),
    ]

    operations = [
        migrations.CreateModel(
            name="ThermometerReading",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("reading", models.DecimalField(decimal_places=2, max_digits=8)),
                (
                    "read_at",
                    models.DateTimeField(
                        db_index=True, default=django.utils.timezone.now
                    ),
                ),
                (
                    "thermometer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="readings",
                        to="sensors.thermometer",
                    ),
                ),
            ],
            options={
                "ordering": ["-read_at"],
                "indexes": [
                    models.Index(
                        fields=["thermometer", "read_at"],
                        name="sensors_the_thermom_615c9d_idx",
                    )
                ],
            },
        ),
    ]
