# Generated by Django 2.1.4 on 2019-01-03 00:27

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('temperature_monitor', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Gateway',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('serial_number', models.CharField(max_length=30, unique=True)),
                ('last_seen', models.DateTimeField(blank=True, help_text='Time gateway was last seen.', null=True)),
                ('_timezone', models.CharField(blank=True, help_text="Gateway's current time zone.", max_length=30, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Query',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.DateTimeField(blank=True, help_text='Time query started.', null=True, unique=True)),
                ('gateway_count', models.PositiveSmallIntegerField(default=0, help_text='Number of gateways queried.')),
                ('sensor_count', models.PositiveSmallIntegerField(default=0, help_text='Number of sensors queried.')),
                ('timepoint_count', models.PositiveSmallIntegerField(default=0, help_text='Number of timepoints queried.')),
                ('duration', models.DurationField(blank=True, help_text='Duration of query (seconds).', null=True)),
            ],
            options={
                'ordering': ['-time'],
                'get_latest_by': ['time'],
            },
        ),
        migrations.AddField(
            model_name='sensor',
            name='gateway',
            field=models.ForeignKey(blank=True, help_text='Gateway this sensor is connected to.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sensors', to='temperature_monitor.Gateway'),
        ),
    ]

# Generated by Django 2.1.4 on 2019-01-03 00:27

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('temperature_monitor', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Gateway',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('serial_number', models.CharField(max_length=30, unique=True)),
                ('last_seen', models.DateTimeField(blank=True, help_text='Time gateway was last seen.', null=True)),
                ('_timezone', models.CharField(blank=True, help_text="Gateway's current time zone.", max_length=30, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Query',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.DateTimeField(blank=True, help_text='Time query started.', null=True, unique=True)),
                ('gateway_count', models.PositiveSmallIntegerField(default=0, help_text='Number of gateways queried.')),
                ('sensor_count', models.PositiveSmallIntegerField(default=0, help_text='Number of sensors queried.')),
                ('timepoint_count', models.PositiveSmallIntegerField(default=0, help_text='Number of timepoints queried.')),
                ('duration', models.DurationField(blank=True, help_text='Duration of query (seconds).', null=True)),
            ],
            options={
                'ordering': ['-time'],
                'get_latest_by': ['time'],
            },
        ),
        migrations.AddField(
            model_name='sensor',
            name='gateway',
            field=models.ForeignKey(blank=True, help_text='Gateway this sensor is connected to.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='sensors', to='temperature_monitor.Gateway'),
        ),
    ]

# Generated by Django 2.1.4 on 2019-01-03 00:27