From c0eed4c6d230d6bcaf55de9631ea9eb5c00357fe Mon Sep 17 00:00:00 2001 From: Anthony Romaniello Date: Fri, 10 May 2024 07:39:07 -0600 Subject: [PATCH 1/2] Make and apply migratiosn for tasks and status models --- .../migrations/0004_auto_20240510_1334.py | 31 +++++++++++++++++++ .../0006_alter_taskresult_duration.py | 23 ++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 src/status/migrations/0004_auto_20240510_1334.py create mode 100644 src/tasks/migrations/0006_alter_taskresult_duration.py diff --git a/src/status/migrations/0004_auto_20240510_1334.py b/src/status/migrations/0004_auto_20240510_1334.py new file mode 100644 index 00000000..0448f838 --- /dev/null +++ b/src/status/migrations/0004_auto_20240510_1334.py @@ -0,0 +1,31 @@ +# Generated by Django 3.2.25 on 2024-05-10 13:34 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("status", "0003_auto_20211217_2229"), + ] + + operations = [ + migrations.AlterField( + model_name="location", + name="latitude", + field=models.DecimalField( + decimal_places=6, + help_text="Latitude of the sensor in decimal degrees (WGS84).", + max_digits=9, + ), + ), + migrations.AlterField( + model_name="location", + name="longitude", + field=models.DecimalField( + decimal_places=6, + help_text="Longitude of the sensor in decimal degrees (WGS84).", + max_digits=9, + ), + ), + ] diff --git a/src/tasks/migrations/0006_alter_taskresult_duration.py b/src/tasks/migrations/0006_alter_taskresult_duration.py new file mode 100644 index 00000000..89ebbbff --- /dev/null +++ b/src/tasks/migrations/0006_alter_taskresult_duration.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.25 on 2024-05-10 13:34 + +import datetime + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("tasks", "0005_acquisition_data_encrypted"), + ] + + operations = [ + migrations.AlterField( + model_name="taskresult", + name="duration", + field=models.DurationField( + default=datetime.timedelta(0), + help_text="Task duration, in %H:%M:%S.%f format", + ), + ), + ] From 62948216fcdadf5810fccdb92f39223658925b83 Mon Sep 17 00:00:00 2001 From: Anthony Romaniello Date: Fri, 10 May 2024 07:52:51 -0600 Subject: [PATCH 2/2] Set default type for auto-created primary keys --- src/sensor/settings.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sensor/settings.py b/src/sensor/settings.py index d1a46a9f..c8392cfc 100644 --- a/src/sensor/settings.py +++ b/src/sensor/settings.py @@ -453,3 +453,6 @@ USB_DEVICE = env("USB_DEVICE", default=None) STARTUP_CALIBRATION_ACTION = env("STARTUP_CALIBRATION_ACTION", default=None) RAY_INIT = env.bool("RAY_INIT", default=False) + +# Set default field type for Django auto-created primary keys +DEFAULT_AUTO_FIELD = "django.db.models.AutoField"