# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2018-03-16 20:12
from __future__ import unicode_literals

import app.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import enumfields.fields


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('app', '0008_auto_20180125_2034'),
    ]

    operations = [
        migrations.CreateModel(
            name='Home',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('location', models.CharField(max_length=1000)),
                ('type', enumfields.fields.EnumField(default=b'UNKNOWN', enum=app.models.HomeType, max_length=20)),
            ],
            options={
                'db_table': 'home',
            },
        ),
        migrations.CreateModel(
            name='HomeData',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reactive_power', models.FloatField(default=0)),
                ('real_power', models.FloatField(default=0)),
                ('state_of_charge', models.FloatField(default=0)),
                ('dt_stamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('home', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.Home')),
            ],
            options={
                'db_table': 'home_data',
            },
        ),
        migrations.CreateModel(
            name='PowernetUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=50, null=True)),
                ('last_name', models.CharField(max_length=50, null=True)),
                ('email', models.EmailField(blank=True, max_length=254, null=True, unique=True)),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now)),
                ('last_access_dt_stamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, unique=True)),
            ],
            options={
                'db_table': 'powernet_user',
            },
        ),
        migrations.AddField(
            model_name='home',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.PowernetUser'),
        ),
    ]
