# Generated by Django 2.1.1 on 2018-11-10 07:27

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('IoT_DataMgmt', '0022_equipmentinstancedatafielddailyaggregate'),
    ]

    operations = [
        migrations.CreateModel(
            name='EquipmentInstanceDataFieldDailyAgg',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('date', models.DateField()),
                ('daily_count', models.IntegerField(default=0)),
                ('daily_distinct_value_counts', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
                ('daily_min', models.FloatField(blank=True, null=True)),
                ('daily_quartile', models.FloatField(blank=True, null=True)),
                ('daily_median', models.FloatField(blank=True, null=True)),
                ('daily_mean', models.FloatField(blank=True, null=True)),
                ('daily_3rd_quartile', models.FloatField(blank=True, null=True)),
                ('daily_max', models.FloatField(blank=True, null=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('equipment_data_field', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='equipment_instance_data_field_daily_aggs', related_query_name='equipment_instance_data_field_daily_agg', to='IoT_DataMgmt.EquipmentDataField')),
                ('equipment_instance', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='equipment_instance_data_field_daily_aggs', related_query_name='equipment_instance_data_field_daily_agg', to='IoT_DataMgmt.EquipmentInstance')),
            ],
            options={
                'ordering': ('equipment_instance', 'equipment_data_field', 'date'),
            },
        ),
        migrations.RemoveField(
            model_name='equipmentinstancedatafielddailyaggregate',
            name='equipment_data_field',
        ),
        migrations.RemoveField(
            model_name='equipmentinstancedatafielddailyaggregate',
            name='equipment_instance',
        ),
        migrations.DeleteModel(
            name='EquipmentInstanceDataFieldDailyAggregate',
        ),
    ]

# Generated by Django 2.1.1 on 2018-11-10 07:27

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('IoT_DataMgmt', '0022_equipmentinstancedatafielddailyaggregate'),
    ]

    operations = [
        migrations.CreateModel(
            name='EquipmentInstanceDataFieldDailyAgg',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('date', models.DateField()),
                ('daily_count', models.IntegerField(default=0)),
                ('daily_distinct_value_counts', django.contrib.postgres.fields.jsonb.JSONField(default=dict)),
                ('daily_min', models.FloatField(blank=True, null=True)),
                ('daily_quartile', models.FloatField(blank=True, null=True)),
                ('daily_median', models.FloatField(blank=True, null=True)),
                ('daily_mean', models.FloatField(blank=True, null=True)),
                ('daily_3rd_quartile', models.FloatField(blank=True, null=True)),
                ('daily_max', models.FloatField(blank=True, null=True)),
                ('last_updated', models.DateTimeField(auto_now=True)),
                ('equipment_data_field', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='equipment_instance_data_field_daily_aggs', related_query_name='equipment_instance_data_field_daily_agg', to='IoT_DataMgmt.EquipmentDataField')),
                ('equipment_instance', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='equipment_instance_data_field_daily_aggs', related_query_name='equipment_instance_data_field_daily_agg', to='IoT_DataMgmt.EquipmentInstance')),
            ],
            options={
                'ordering': ('equipment_instance', 'equipment_data_field', 'date'),
            },
        ),
        migrations.RemoveField(
            model_name='equipmentinstancedatafielddailyaggregate',
            name='equipment_data_field',
        ),
        migrations.RemoveField(
            model_name='equipmentinstancedatafielddailyaggregate',
            name='equipment_instance',
        ),
        migrations.DeleteModel(
            name='EquipmentInstanceDataFieldDailyAggregate',
        ),
    ]

# Generated by Django 2.1.1 on 2018-11-10 07:27