-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #131 from ImperialCollegeLondon/new_meas2
Adds the new Measurement model
- Loading branch information
Showing
5 changed files
with
497 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
# Generated by Django 4.2.7 on 2024-01-17 15:08 | ||
|
||
import django.db.models.deletion | ||
import timescale.db.models.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("station", "0003_alter_station_timezone"), | ||
("variable", "0001_initial"), | ||
("measurement", "0005_report"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="Measurement", | ||
fields=[ | ||
( | ||
"id", | ||
models.AutoField( | ||
auto_created=True, | ||
primary_key=True, | ||
serialize=False, | ||
verbose_name="ID", | ||
), | ||
), | ||
( | ||
"time", | ||
timescale.db.models.fields.TimescaleDateTimeField(interval="1 day"), | ||
), | ||
( | ||
"value", | ||
models.DecimalField( | ||
decimal_places=6, max_digits=14, verbose_name="value" | ||
), | ||
), | ||
( | ||
"maximum", | ||
models.DecimalField( | ||
decimal_places=6, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="maximum", | ||
), | ||
), | ||
( | ||
"minimum", | ||
models.DecimalField( | ||
decimal_places=6, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="minimum", | ||
), | ||
), | ||
( | ||
"depth", | ||
models.PositiveSmallIntegerField(null=True, verbose_name="depth"), | ||
), | ||
( | ||
"direction", | ||
models.DecimalField( | ||
decimal_places=6, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="direction", | ||
), | ||
), | ||
( | ||
"raw_value", | ||
models.DecimalField( | ||
decimal_places=6, | ||
editable=False, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="raw value", | ||
), | ||
), | ||
( | ||
"raw_maximum", | ||
models.DecimalField( | ||
decimal_places=6, | ||
editable=False, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="raw maximum", | ||
), | ||
), | ||
( | ||
"raw_minimum", | ||
models.DecimalField( | ||
decimal_places=6, | ||
editable=False, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="raw minimum", | ||
), | ||
), | ||
( | ||
"raw_direction", | ||
models.DecimalField( | ||
decimal_places=6, | ||
editable=False, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="raw direction", | ||
), | ||
), | ||
( | ||
"raw_depth", | ||
models.PositiveSmallIntegerField( | ||
editable=False, null=True, verbose_name="raw depth" | ||
), | ||
), | ||
( | ||
"used_for_hourly", | ||
models.BooleanField( | ||
default=False, | ||
verbose_name="Has data been used already for an hourly report?", | ||
), | ||
), | ||
( | ||
"is_validated", | ||
models.BooleanField( | ||
default=False, verbose_name="Has data been validated?" | ||
), | ||
), | ||
( | ||
"is_active", | ||
models.BooleanField(default=True, verbose_name="Is data active?"), | ||
), | ||
( | ||
"station", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="station.station", | ||
verbose_name="Station", | ||
), | ||
), | ||
( | ||
"variable", | ||
models.ForeignKey( | ||
on_delete=django.db.models.deletion.PROTECT, | ||
to="variable.variable", | ||
verbose_name="Variable", | ||
), | ||
), | ||
], | ||
options={ | ||
"abstract": False, | ||
"default_permissions": (), | ||
"indexes": [ | ||
models.Index( | ||
fields=["station", "time", "variable"], | ||
name="measurement_station_322060_idx", | ||
) | ||
], | ||
}, | ||
), | ||
] |
154 changes: 154 additions & 0 deletions
154
measurement/migrations/0007_alter_measurement_depth_alter_measurement_direction_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
# Generated by Django 4.2.7 on 2024-01-17 15:28 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("measurement", "0006_measurement"), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="depth", | ||
field=models.PositiveSmallIntegerField( | ||
blank=True, null=True, verbose_name="depth" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="direction", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="direction", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="is_active", | ||
field=models.BooleanField(default=True, verbose_name="Active?"), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="is_validated", | ||
field=models.BooleanField(default=False, verbose_name="Validated?"), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="maximum", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="maximum", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="minimum", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="minimum", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="raw_depth", | ||
field=models.PositiveSmallIntegerField( | ||
blank=True, editable=False, null=True, verbose_name="raw depth" | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="raw_direction", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
editable=False, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="raw direction", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="raw_maximum", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
editable=False, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="raw maximum", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="raw_minimum", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
editable=False, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="raw minimum", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="raw_value", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
editable=False, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="raw value", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="measurement", | ||
name="used_for_hourly", | ||
field=models.BooleanField(default=False, verbose_name="Used for hourly?"), | ||
), | ||
migrations.AlterField( | ||
model_name="report", | ||
name="maximum", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="maximum", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="report", | ||
name="minimum", | ||
field=models.DecimalField( | ||
blank=True, | ||
decimal_places=6, | ||
max_digits=14, | ||
null=True, | ||
verbose_name="minimum", | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name="report", | ||
name="used_for_daily", | ||
field=models.BooleanField(default=False, verbose_name="Used for daily?"), | ||
), | ||
migrations.AlterField( | ||
model_name="report", | ||
name="used_for_monthly", | ||
field=models.BooleanField(default=False, verbose_name="Used for monthly?"), | ||
), | ||
] |
Oops, something went wrong.