# Generated by Django 2.1.1 on 2020-05-03 10:06

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='Meter',
            fields=[
                ('MeterId', models.AutoField(primary_key=True, serialize=False)),
            ],
            options={
                'db_table': 'Meter',
            },
        ),
        migrations.CreateModel(
            name='MeterData',
            fields=[
                ('ReadingId', models.AutoField(primary_key=True, serialize=False)),
                ('ReadAt', models.DateTimeField(default=django.utils.timezone.now)),
                ('KWH', models.FloatField()),
                ('KW', models.FloatField()),
                ('KVA', models.FloatField()),
                ('KVAr', models.FloatField()),
                ('Ph1i', models.FloatField()),
                ('Ph2i', models.FloatField()),
                ('Ph3i', models.FloatField()),
                ('Ph1v', models.FloatField()),
                ('Ph2v', models.FloatField()),
                ('Ph3v', models.FloatField()),
                ('PF', models.FloatField()),
                ('MeterId', models.ForeignKey(blank=True, db_column='MeterId', null=True, on_delete=django.db.models.deletion.SET_NULL, to='webapp.Meter')),
            ],
            options={
                'db_table': 'MeterData',
            },
        ),
        migrations.CreateModel(
            name='ServiceArea',
            fields=[
                ('AreaId', models.AutoField(primary_key=True, serialize=False)),
                ('AreaName', models.CharField(max_length=64)),
            ],
            options={
                'db_table': 'ServiceArea',
            },
        ),
        migrations.AddField(
            model_name='meter',
            name='AreaId',
            field=models.ForeignKey(blank=True, db_column='AreaId', null=True, on_delete=django.db.models.deletion.SET_NULL, to='webapp.ServiceArea'),
        ),
    ]
