This commit is contained in:
2026-04-11 03:54:15 +03:30
parent 883573004c
commit 36d6b05a7f
68 changed files with 3487 additions and 841 deletions
+43
View File
@@ -0,0 +1,43 @@
import django.db.models.deletion
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("farm_hub", "0007_farmhub_subscription_plan"),
]
operations = [
migrations.CreateModel(
name="WeatherForecastLog",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("uuid", models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True)),
("condition", models.CharField(blank=True, default="", max_length=128)),
("temperature", models.FloatField(blank=True, null=True)),
("unit", models.CharField(blank=True, default="°C", max_length=16)),
("humidity", models.IntegerField(blank=True, null=True)),
("wind_speed", models.FloatField(blank=True, null=True)),
("wind_unit", models.CharField(blank=True, default="km/h", max_length=16)),
("chart_data", models.JSONField(blank=True, default=dict)),
("fetched_at", models.DateTimeField(auto_now_add=True)),
(
"farm",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="weather_forecasts",
to="farm_hub.farmhub",
),
),
],
options={
"db_table": "weather_forecast_logs",
"ordering": ["-fetched_at"],
},
),
]
View File