<gh_stars>0
# Generated by Django 2.0.7 on 2018-10-08 04:50

import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=128)),
                ('description', models.TextField(blank=True)),
                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('height', models.DecimalField(decimal_places=3, max_digits=7)),
            ],
        ),
        migrations.CreateModel(
            name='WeatherObservation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(default=django.utils.timezone.now)),
                ('raw_data', models.TextField()),
                ('temperature_min', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('temperature_max', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('temperature', models.DecimalField(blank=True, decimal_places=1, help_text='Temperature (°Celcius)', max_digits=4, null=True)),
                ('temperature_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('temperature_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('pressure_min', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True)),
                ('pressure_max', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True)),
                ('pressure', models.DecimalField(blank=True, decimal_places=1, help_text='Pressure (hPa)', max_digits=5, null=True)),
                ('pressure_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True)),
                ('pressure_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('humidity_min', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('humidity_max', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('humidity', models.DecimalField(blank=True, decimal_places=1, help_text='Relative humidity (%)', max_digits=4, null=True)),
                ('humidity_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('humidity_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('wind_direction_max', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_direction_min', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_direction', models.DecimalField(blank=True, decimal_places=1, help_text='Wind direction (° from N)', max_digits=4, null=True)),
                ('wind_direction_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_direction_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('wind_speed_max', models.DecimalField(blank=True, decimal_places=1, help_text='Wind gust (km/h)', max_digits=4, null=True)),
                ('wind_speed_min', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed', models.DecimalField(blank=True, decimal_places=1, help_text='Wind speed (km/h)', max_digits=4, null=True)),
                ('wind_speed_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('wind_speed_max_kn', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed_min_kn', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed_kn', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed_deviation_kn', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('rainfall', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('actual_rainfall', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('actual_pressure', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True)),
            ],
            options={
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='WeatherStation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('abbreviation', models.CharField(help_text='Internal abbreviation code', max_length=20, unique=True)),
                ('bom_abbreviation', models.CharField(help_text='Bureau of Meteorology site abbrevation code', max_length=4, unique=True, verbose_name='BoM abbreviation')),
                ('ip_address', models.GenericIPAddressField(verbose_name='IPv4 address')),
                ('port', models.PositiveIntegerField(default=43000)),
                ('last_scheduled', models.DateTimeField()),
                ('last_reading', models.DateTimeField()),
                ('battery_voltage', models.DecimalField(decimal_places=1, max_digits=3)),
                ('connect_every', models.PositiveSmallIntegerField(default=15)),
                ('active', models.BooleanField(default=False)),
                ('manufacturer', models.CharField(blank=True, choices=[('telvent', 'Telvent'), ('vaisala', 'Vaisala')], max_length=100, null=True)),
                ('upload_data', models.BooleanField(default=True, help_text='Upload observation data to external consumers (e.g. DAFWA)')),
                ('location', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='weather.Location')),
            ],
            options={
                'ordering': ['-last_reading'],
            },
        ),
        migrations.AddField(
            model_name='weatherobservation',
            name='station',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='readings', to='weather.WeatherStation'),
        ),
        migrations.AlterUniqueTogether(
            name='weatherobservation',
            unique_together={('station', 'date')},
        ),
    ]

# Generated by Django 2.0.7 on 2018-10-08 04:50

import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, max_length=128)),
                ('description', models.TextField(blank=True)),
                ('point', django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('height', models.DecimalField(decimal_places=3, max_digits=7)),
            ],
        ),
        migrations.CreateModel(
            name='WeatherObservation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(default=django.utils.timezone.now)),
                ('raw_data', models.TextField()),
                ('temperature_min', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('temperature_max', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('temperature', models.DecimalField(blank=True, decimal_places=1, help_text='Temperature (°Celcius)', max_digits=4, null=True)),
                ('temperature_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('temperature_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('pressure_min', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True)),
                ('pressure_max', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True)),
                ('pressure', models.DecimalField(blank=True, decimal_places=1, help_text='Pressure (hPa)', max_digits=5, null=True)),
                ('pressure_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True)),
                ('pressure_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('humidity_min', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('humidity_max', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('humidity', models.DecimalField(blank=True, decimal_places=1, help_text='Relative humidity (%)', max_digits=4, null=True)),
                ('humidity_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('humidity_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('wind_direction_max', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_direction_min', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_direction', models.DecimalField(blank=True, decimal_places=1, help_text='Wind direction (° from N)', max_digits=4, null=True)),
                ('wind_direction_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_direction_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('wind_speed_max', models.DecimalField(blank=True, decimal_places=1, help_text='Wind gust (km/h)', max_digits=4, null=True)),
                ('wind_speed_min', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed', models.DecimalField(blank=True, decimal_places=1, help_text='Wind speed (km/h)', max_digits=4, null=True)),
                ('wind_speed_deviation', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed_outliers', models.PositiveIntegerField(blank=True, null=True)),
                ('wind_speed_max_kn', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed_min_kn', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed_kn', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('wind_speed_deviation_kn', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('rainfall', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('actual_rainfall', models.DecimalField(blank=True, decimal_places=1, max_digits=4, null=True)),
                ('actual_pressure', models.DecimalField(blank=True, decimal_places=1, max_digits=5, null=True)),
            ],
            options={
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='WeatherStation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('abbreviation', models.CharField(help_text='Internal abbreviation code', max_length=20, unique=True)),
                ('bom_abbreviation', models.CharField(help_text='Bureau of Meteorology site abbrevation code', max_length=4, unique=True, verbose_name='BoM abbreviation')),
                ('ip_address', models.GenericIPAddressField(verbose_name='IPv4 address')),
                ('port', models.PositiveIntegerField(default=43000)),
                ('last_scheduled', models.DateTimeField()),
                ('last_reading', models.DateTimeField()),
                ('battery_voltage', models.DecimalField(decimal_places=1, max_digits=3)),
                ('connect_every', models.PositiveSmallIntegerField(default=15)),
                ('active', models.BooleanField(default=False)),
                ('manufacturer', models.CharField(blank=True, choices=[('telvent', 'Telvent'), ('vaisala', 'Vaisala')], max_length=100, null=True)),
                ('upload_data', models.BooleanField(default=True, help_text='Upload observation data to external consumers (e.g. DAFWA)')),
                ('location', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='weather.Location')),
            ],
            options={
                'ordering': ['-last_reading'],
            },
        ),
        migrations.AddField(
            model_name='weatherobservation',
            name='station',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='readings', to='weather.WeatherStation'),
        ),
        migrations.AlterUniqueTogether(
            name='weatherobservation',
            unique_together={('station', 'date')},
        ),
    ]
# Generated by Django 2.0.7 on 2018-10-08 04:50