From 13dfc699dea1acda3d31e8476edd6737ae468e3e Mon Sep 17 00:00:00 2001 From: glass-ships Date: Tue, 17 Sep 2024 12:35:04 -0400 Subject: [PATCH 01/11] Modify to retain user plots, purging beamline plots --- .../plots/migrations/0002_datarun_expiration_date.py | 12 ++++++++++++ .../migrations/0003_alter_default_auto_fields.py | 3 ++- src/apps/plots/models.py | 10 ++++++---- src/apps/plots/views.py | 3 ++- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/apps/plots/migrations/0002_datarun_expiration_date.py b/src/apps/plots/migrations/0002_datarun_expiration_date.py index 8f1470a..0b04f66 100644 --- a/src/apps/plots/migrations/0002_datarun_expiration_date.py +++ b/src/apps/plots/migrations/0002_datarun_expiration_date.py @@ -2,9 +2,20 @@ import datetime +from django.conf import settings from django.db import migrations, models +def set_expiration_date(apps, schema_editor): + DataRun = apps.get_model("plots", "DataRun") + for run in DataRun.objects.all(): + if run.run_number == 0: + run.expiration_date = run.created_on + datetime.timedelta(days=365*100) + else: + run.expiration_date = run.created_on + datetime.timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME) + run.save() + + class Migration(migrations.Migration): dependencies = [ ("plots", "0001_initial"), @@ -19,4 +30,5 @@ class Migration(migrations.Migration): verbose_name="Expires", ), ), + migrations.RunPython(set_expiration_date), ] diff --git a/src/apps/plots/migrations/0003_alter_default_auto_fields.py b/src/apps/plots/migrations/0003_alter_default_auto_fields.py index c7a6588..a50269e 100644 --- a/src/apps/plots/migrations/0003_alter_default_auto_fields.py +++ b/src/apps/plots/migrations/0003_alter_default_auto_fields.py @@ -5,7 +5,8 @@ class Migration(migrations.Migration): dependencies = [ - ("plots", "0002_datarun_expiration_date"), + ("plots", "0001_initial"), + # ("plots", "0002_datarun_expiration_date"), ] operations = [ diff --git a/src/apps/plots/models.py b/src/apps/plots/models.py index 0f16ac4..1032ba4 100644 --- a/src/apps/plots/models.py +++ b/src/apps/plots/models.py @@ -8,7 +8,6 @@ from django.conf import settings from django.db import models -from django.utils import timezone DATA_TYPES = {"json": 0, "html": 1, "div": 1} DATA_TYPE_INFO = {0: {"name": "json"}, 1: {"name": "html"}} @@ -41,9 +40,12 @@ class DataRun(models.Model): run_id = models.TextField() instrument = models.ForeignKey(Instrument, on_delete=models.deletion.CASCADE) created_on = models.DateTimeField("Timestamp", auto_now_add=True) - expiration_date = models.DateTimeField( - "Expires", default=timezone.now() + timedelta(days=(settings.LIVE_PLOT_EXPIRATION_TIME)) - ) + expiration_date = models.DateTimeField("Expires", default=None, null=True, blank=True) + # expiration_date = models.DateTimeField("Expires", created_on + timedelta(days=(settings.LIVE_PLOT_EXPIRATION_TIME))) + + def clean(self): + if self.expiration_date is None: + self.expiration_date = self.created_on + timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME) def __str__(self): return f"{self.instrument}_{self.run_number}_{self.run_id}" diff --git a/src/apps/plots/views.py b/src/apps/plots/views.py index c7be7db..b4e9ce6 100644 --- a/src/apps/plots/views.py +++ b/src/apps/plots/views.py @@ -99,7 +99,8 @@ def _store(request, instrument, run_id=None, as_user=False): data_type_default = PlotData.get_data_type_from_data(raw_data) data_type = request.POST.get("data_type", default=data_type_default) expiration_date = request.POST.get( - "expiration_date", default=timezone.now() + timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME) + "expiration_date", + default=timezone.now() + timedelta(days=365*100 if as_user else settings.LIVE_PLOT_EXPIRATION_TIME), ) if as_user: From a94a6896f06feee55d07f59b12eb7e4f09d366d6 Mon Sep 17 00:00:00 2001 From: glass-ships Date: Tue, 17 Sep 2024 12:51:47 -0400 Subject: [PATCH 02/11] modify migrations --- src/apps/plots/migrations/0001_initial.py | 6 ++-- .../0002_datarun_expiration_date.py | 2 +- .../0003_alter_default_auto_fields.py | 28 ------------------- 3 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 src/apps/plots/migrations/0003_alter_default_auto_fields.py diff --git a/src/apps/plots/migrations/0001_initial.py b/src/apps/plots/migrations/0001_initial.py index 2a55632..8579090 100644 --- a/src/apps/plots/migrations/0001_initial.py +++ b/src/apps/plots/migrations/0001_initial.py @@ -13,7 +13,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name="DataRun", fields=[ - ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ("run_number", models.IntegerField()), ("run_id", models.TextField()), ("created_on", models.DateTimeField(auto_now_add=True, verbose_name="Timestamp")), @@ -22,7 +22,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name="Instrument", fields=[ - ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ("name", models.CharField(max_length=128, unique=True)), ("run_id_type", models.IntegerField(default=0)), ], @@ -30,7 +30,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name="PlotData", fields=[ - ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ("data_type", models.IntegerField()), ("data", models.TextField()), ("timestamp", models.DateTimeField(verbose_name="Timestamp")), diff --git a/src/apps/plots/migrations/0002_datarun_expiration_date.py b/src/apps/plots/migrations/0002_datarun_expiration_date.py index 0b04f66..d73f104 100644 --- a/src/apps/plots/migrations/0002_datarun_expiration_date.py +++ b/src/apps/plots/migrations/0002_datarun_expiration_date.py @@ -26,7 +26,7 @@ class Migration(migrations.Migration): model_name="datarun", name="expiration_date", field=models.DateTimeField( - default=datetime.datetime(2027, 8, 8, 18, 55, 41, 999298, tzinfo=datetime.timezone.utc), + default=None, verbose_name="Expires", ), ), diff --git a/src/apps/plots/migrations/0003_alter_default_auto_fields.py b/src/apps/plots/migrations/0003_alter_default_auto_fields.py deleted file mode 100644 index a50269e..0000000 --- a/src/apps/plots/migrations/0003_alter_default_auto_fields.py +++ /dev/null @@ -1,28 +0,0 @@ -# Generated by Django 4.2.15 on 2024-08-23 14:47 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - dependencies = [ - ("plots", "0001_initial"), - # ("plots", "0002_datarun_expiration_date"), - ] - - operations = [ - migrations.AlterField( - model_name="datarun", - name="id", - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), - ), - migrations.AlterField( - model_name="instrument", - name="id", - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), - ), - migrations.AlterField( - model_name="plotdata", - name="id", - field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), - ), - ] From 52f2aaba59bc6f798936265d9a78d0c51c405656 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 16:55:07 +0000 Subject: [PATCH 03/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/apps/plots/migrations/0002_datarun_expiration_date.py | 2 +- src/apps/plots/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/plots/migrations/0002_datarun_expiration_date.py b/src/apps/plots/migrations/0002_datarun_expiration_date.py index d73f104..b19cdb3 100644 --- a/src/apps/plots/migrations/0002_datarun_expiration_date.py +++ b/src/apps/plots/migrations/0002_datarun_expiration_date.py @@ -10,7 +10,7 @@ def set_expiration_date(apps, schema_editor): DataRun = apps.get_model("plots", "DataRun") for run in DataRun.objects.all(): if run.run_number == 0: - run.expiration_date = run.created_on + datetime.timedelta(days=365*100) + run.expiration_date = run.created_on + datetime.timedelta(days=365 * 100) else: run.expiration_date = run.created_on + datetime.timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME) run.save() diff --git a/src/apps/plots/views.py b/src/apps/plots/views.py index b4e9ce6..faff750 100644 --- a/src/apps/plots/views.py +++ b/src/apps/plots/views.py @@ -100,7 +100,7 @@ def _store(request, instrument, run_id=None, as_user=False): data_type = request.POST.get("data_type", default=data_type_default) expiration_date = request.POST.get( "expiration_date", - default=timezone.now() + timedelta(days=365*100 if as_user else settings.LIVE_PLOT_EXPIRATION_TIME), + default=timezone.now() + timedelta(days=365 * 100 if as_user else settings.LIVE_PLOT_EXPIRATION_TIME), ) if as_user: From 06eba04491f176764dc804411520e90848335fbc Mon Sep 17 00:00:00 2001 From: glass-ships Date: Tue, 17 Sep 2024 12:57:47 -0400 Subject: [PATCH 04/11] fix pre-commit --- src/apps/plots/migrations/0002_datarun_expiration_date.py | 2 +- src/apps/plots/models.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apps/plots/migrations/0002_datarun_expiration_date.py b/src/apps/plots/migrations/0002_datarun_expiration_date.py index b19cdb3..d69e081 100644 --- a/src/apps/plots/migrations/0002_datarun_expiration_date.py +++ b/src/apps/plots/migrations/0002_datarun_expiration_date.py @@ -6,7 +6,7 @@ from django.db import migrations, models -def set_expiration_date(apps, schema_editor): +def set_expiration_date(apps, _): DataRun = apps.get_model("plots", "DataRun") for run in DataRun.objects.all(): if run.run_number == 0: diff --git a/src/apps/plots/models.py b/src/apps/plots/models.py index 1032ba4..4f26f1c 100644 --- a/src/apps/plots/models.py +++ b/src/apps/plots/models.py @@ -41,7 +41,9 @@ class DataRun(models.Model): instrument = models.ForeignKey(Instrument, on_delete=models.deletion.CASCADE) created_on = models.DateTimeField("Timestamp", auto_now_add=True) expiration_date = models.DateTimeField("Expires", default=None, null=True, blank=True) - # expiration_date = models.DateTimeField("Expires", created_on + timedelta(days=(settings.LIVE_PLOT_EXPIRATION_TIME))) + # expiration_date = models.DateTimeField( + # "Expires", created_on + timedelta(days=(settings.LIVE_PLOT_EXPIRATION_TIME)) + # ) def clean(self): if self.expiration_date is None: From e2b5025de50fb74d2f804f128af3cb00ea11d6e9 Mon Sep 17 00:00:00 2001 From: glass-ships Date: Tue, 17 Sep 2024 14:47:25 -0400 Subject: [PATCH 05/11] add instruments enum, use that to differentiate --- .../0002_datarun_expiration_date.py | 8 ++-- src/config/instruments.py | 43 +++++++++++++++++++ 2 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 src/config/instruments.py diff --git a/src/apps/plots/migrations/0002_datarun_expiration_date.py b/src/apps/plots/migrations/0002_datarun_expiration_date.py index d69e081..ae39edd 100644 --- a/src/apps/plots/migrations/0002_datarun_expiration_date.py +++ b/src/apps/plots/migrations/0002_datarun_expiration_date.py @@ -5,14 +5,16 @@ from django.conf import settings from django.db import migrations, models +from config.instruments import Instruments + def set_expiration_date(apps, _): DataRun = apps.get_model("plots", "DataRun") for run in DataRun.objects.all(): - if run.run_number == 0: - run.expiration_date = run.created_on + datetime.timedelta(days=365 * 100) - else: + if Instruments.has_value(run.instrument.name): run.expiration_date = run.created_on + datetime.timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME) + else: + run.expiration_date = run.created_on + datetime.timedelta(days=365 * 100) run.save() diff --git a/src/config/instruments.py b/src/config/instruments.py new file mode 100644 index 0000000..65f8d3e --- /dev/null +++ b/src/config/instruments.py @@ -0,0 +1,43 @@ +from enum import StrEnum + + +class Instruments(StrEnum): + ARCS = "arcs" + CG2 = "cg2" + CNCs = "cncs" + CORELLI = "corelli" + EQSANS = "eqsans" + HB2A = "hb2a" + HB2B = "hb2b" + HB2C = "hb2c" + HB3A = "hb3a" + HYS = "hys" + MANDI = "mandi" + NOM = "nom" + PG3 = "pg3" + REF_L = "ref_l" + REF_M = "ref_m" + SEQ = "seq" + SNAP = "snap" + TOPAZ = "topaz" + USANS = "usans" + VULCAN = "vulcan" + # instruments that haven't published to livedata yet + BL0 = "bl0" + BSS = "bss" + CG1D = "cg1d" + CG3 = "cg3" + FNPB = "fnpb" + HB3 = "hb3" + NOWB = "nowb" + NOWD = "nowd" + NOWG = "nowg" + NOWV = "nowv" + NOWX = "nowx" + NSE = "nse" + VENUS = "venus" + VIS = "vis" + + @classmethod + def has_value(cls, value): + return any(value == item.value for item in cls) From 92b7073d87706126c4b1898d7e59f6f3ffa181b4 Mon Sep 17 00:00:00 2001 From: glass-ships Date: Wed, 18 Sep 2024 09:39:30 -0400 Subject: [PATCH 06/11] change to 1/1/2100 for user data --- src/apps/plots/migrations/0002_datarun_expiration_date.py | 3 ++- src/apps/plots/views.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/apps/plots/migrations/0002_datarun_expiration_date.py b/src/apps/plots/migrations/0002_datarun_expiration_date.py index ae39edd..89e73ee 100644 --- a/src/apps/plots/migrations/0002_datarun_expiration_date.py +++ b/src/apps/plots/migrations/0002_datarun_expiration_date.py @@ -4,6 +4,7 @@ from django.conf import settings from django.db import migrations, models +from django.utils import timezone from config.instruments import Instruments @@ -14,7 +15,7 @@ def set_expiration_date(apps, _): if Instruments.has_value(run.instrument.name): run.expiration_date = run.created_on + datetime.timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME) else: - run.expiration_date = run.created_on + datetime.timedelta(days=365 * 100) + run.expiration_date = timezone.datetime(2100, 1, 1, 0, 0, 0, tzinfo=timezone.utc) run.save() diff --git a/src/apps/plots/views.py b/src/apps/plots/views.py index faff750..965dbdb 100644 --- a/src/apps/plots/views.py +++ b/src/apps/plots/views.py @@ -100,7 +100,9 @@ def _store(request, instrument, run_id=None, as_user=False): data_type = request.POST.get("data_type", default=data_type_default) expiration_date = request.POST.get( "expiration_date", - default=timezone.now() + timedelta(days=365 * 100 if as_user else settings.LIVE_PLOT_EXPIRATION_TIME), + default=timezone.datetime(2100, 1, 1, 0, 0, 0, tzinfo=timezone.utc) + if as_user + else timezone.now() + timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME), ) if as_user: From 0a14552ae4c2775f1106883fab02adbfad3479d9 Mon Sep 17 00:00:00 2001 From: glass-ships Date: Wed, 18 Sep 2024 09:44:15 -0400 Subject: [PATCH 07/11] little cleanup --- src/apps/plots/migrations/0002_datarun_expiration_date.py | 5 +---- src/apps/plots/models.py | 3 --- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/apps/plots/migrations/0002_datarun_expiration_date.py b/src/apps/plots/migrations/0002_datarun_expiration_date.py index 89e73ee..86d6c1b 100644 --- a/src/apps/plots/migrations/0002_datarun_expiration_date.py +++ b/src/apps/plots/migrations/0002_datarun_expiration_date.py @@ -28,10 +28,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name="datarun", name="expiration_date", - field=models.DateTimeField( - default=None, - verbose_name="Expires", - ), + field=models.DateTimeField(default=None, verbose_name="Expires"), ), migrations.RunPython(set_expiration_date), ] diff --git a/src/apps/plots/models.py b/src/apps/plots/models.py index 4f26f1c..da2e242 100644 --- a/src/apps/plots/models.py +++ b/src/apps/plots/models.py @@ -41,9 +41,6 @@ class DataRun(models.Model): instrument = models.ForeignKey(Instrument, on_delete=models.deletion.CASCADE) created_on = models.DateTimeField("Timestamp", auto_now_add=True) expiration_date = models.DateTimeField("Expires", default=None, null=True, blank=True) - # expiration_date = models.DateTimeField( - # "Expires", created_on + timedelta(days=(settings.LIVE_PLOT_EXPIRATION_TIME)) - # ) def clean(self): if self.expiration_date is None: From 282783d9a6f9a5d4c53ca3919a8c4d9c30a28e9d Mon Sep 17 00:00:00 2001 From: glass-ships Date: Wed, 18 Sep 2024 10:36:18 -0400 Subject: [PATCH 08/11] update clean() --- src/apps/plots/models.py | 8 +++++++- src/apps/plots/view_util.py | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/apps/plots/models.py b/src/apps/plots/models.py index da2e242..37c34b1 100644 --- a/src/apps/plots/models.py +++ b/src/apps/plots/models.py @@ -8,6 +8,9 @@ from django.conf import settings from django.db import models +from django.utils import timezone + +from config.instruments import Instruments DATA_TYPES = {"json": 0, "html": 1, "div": 1} DATA_TYPE_INFO = {0: {"name": "json"}, 1: {"name": "html"}} @@ -44,7 +47,10 @@ class DataRun(models.Model): def clean(self): if self.expiration_date is None: - self.expiration_date = self.created_on + timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME) + if Instruments.has_value(self.instrument.name): + self.expiration_date = self.created_on + timedelta(days=settings.LIVE_PLOT_EXPIRATION_TIME) + else: + self.expiration_date = timezone.datetime(2100, 1, 1, 0, 0, 0, tzinfo=timezone.utc) def __str__(self): return f"{self.instrument}_{self.run_number}_{self.run_id}" diff --git a/src/apps/plots/view_util.py b/src/apps/plots/view_util.py index 583bbeb..e9a86af 100644 --- a/src/apps/plots/view_util.py +++ b/src/apps/plots/view_util.py @@ -144,10 +144,10 @@ def store_user_data(user, data_id, data, data_type, expiration_date: Optional[da run_obj.run_number = 0 run_obj.run_id = data_id run_obj.expiration_date = expiration_date + # Save run object to generate id (primary key) run_obj.save() - # Since user data have no run number, force the run number to be the PK, - # which is unique and will allow user to retrieve the data like normal - # instrument data. + # User data has no run number, use the unique id as the run number + # so that the user can retrieve the data like normal instrument data run_obj.run_number = run_obj.id run_obj.save() From d2db2a923dc50d1ce5737c6c50e8cdc289b40cfe Mon Sep 17 00:00:00 2001 From: glass-ships Date: Wed, 18 Sep 2024 11:05:48 -0400 Subject: [PATCH 09/11] add enum test, i guess --- tests/test_enum.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 tests/test_enum.py diff --git a/tests/test_enum.py b/tests/test_enum.py new file mode 100644 index 0000000..6846919 --- /dev/null +++ b/tests/test_enum.py @@ -0,0 +1,12 @@ +import sys +from pathlib import Path + +import pytest + +sys.path.append(str(Path(__file__).parents[1])) +from src.config.instruments import Instruments + + +@pytest.mark.parametrize("instrument", ["fake_instrument", "ref_m"]) +def test_enum(instrument): + assert Instruments.has_value(instrument) == (instrument == "ref_m") From 648614512e7d71ab6faf295155b1cf1d5ac68f58 Mon Sep 17 00:00:00 2001 From: glass-ships Date: Wed, 18 Sep 2024 12:25:27 -0400 Subject: [PATCH 10/11] update migration 0002 --- src/apps/plots/migrations/0002_datarun_expiration_date.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/plots/migrations/0002_datarun_expiration_date.py b/src/apps/plots/migrations/0002_datarun_expiration_date.py index 86d6c1b..125f947 100644 --- a/src/apps/plots/migrations/0002_datarun_expiration_date.py +++ b/src/apps/plots/migrations/0002_datarun_expiration_date.py @@ -28,7 +28,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name="datarun", name="expiration_date", - field=models.DateTimeField(default=None, verbose_name="Expires"), + field=models.DateTimeField(default=None, blank=True, null=True, verbose_name="Expires"), ), migrations.RunPython(set_expiration_date), ] From 05f1dd58ce21a2afe4ec9aed7baf9527582c8345 Mon Sep 17 00:00:00 2001 From: glass-ships Date: Wed, 18 Sep 2024 12:27:55 -0400 Subject: [PATCH 11/11] revert change to 0003 and init migrations --- src/apps/plots/migrations/0001_initial.py | 6 ++--- .../0003_alter_default_auto_fields.py | 27 +++++++++++++++++++ 2 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 src/apps/plots/migrations/0003_alter_default_auto_fields.py diff --git a/src/apps/plots/migrations/0001_initial.py b/src/apps/plots/migrations/0001_initial.py index 8579090..2a55632 100644 --- a/src/apps/plots/migrations/0001_initial.py +++ b/src/apps/plots/migrations/0001_initial.py @@ -13,7 +13,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name="DataRun", fields=[ - ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ("run_number", models.IntegerField()), ("run_id", models.TextField()), ("created_on", models.DateTimeField(auto_now_add=True, verbose_name="Timestamp")), @@ -22,7 +22,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name="Instrument", fields=[ - ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ("name", models.CharField(max_length=128, unique=True)), ("run_id_type", models.IntegerField(default=0)), ], @@ -30,7 +30,7 @@ class Migration(migrations.Migration): migrations.CreateModel( name="PlotData", fields=[ - ("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), + ("id", models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), ("data_type", models.IntegerField()), ("data", models.TextField()), ("timestamp", models.DateTimeField(verbose_name="Timestamp")), diff --git a/src/apps/plots/migrations/0003_alter_default_auto_fields.py b/src/apps/plots/migrations/0003_alter_default_auto_fields.py new file mode 100644 index 0000000..c7a6588 --- /dev/null +++ b/src/apps/plots/migrations/0003_alter_default_auto_fields.py @@ -0,0 +1,27 @@ +# Generated by Django 4.2.15 on 2024-08-23 14:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("plots", "0002_datarun_expiration_date"), + ] + + operations = [ + migrations.AlterField( + model_name="datarun", + name="id", + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), + ), + migrations.AlterField( + model_name="instrument", + name="id", + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), + ), + migrations.AlterField( + model_name="plotdata", + name="id", + field=models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID"), + ), + ]