# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-10-05 19:09
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('type', enumfields.fields.EnumField(enum=app.models.DeviceType, max_length=10)),
                ('status', enumfields.fields.EnumField(default=b'UNKNOWN', enum=app.models.DeviceStatus, max_length=10)),
            ],
            options={
                'db_table': 'device',
            },
        ),
        migrations.CreateModel(
            name='DeviceState',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('watt_consumption', models.FloatField()),
                ('measurement_timestamp', models.DateTimeField()),
                ('additional_information', django.contrib.postgres.fields.jsonb.JSONField(blank=True, null=True)),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Device')),
            ],
            options={
                'db_table': 'device_state',
            },
        ),
    ]
