# Generated by Django 2.0.7 on 2018-07-04 05:16

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='Blog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100)),
                ('content', models.TextField(max_length=1000)),
                ('author', models.CharField(max_length=50)),
                ('post_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('read_count', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='DataRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('record_time', models.DateTimeField(default=django.utils.timezone.now)),
                ('val1', models.IntegerField()),
                ('val2', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mac', models.CharField(max_length=50, unique=True, verbose_name='MAC地址')),
                ('name', models.CharField(default='-', max_length=50, verbose_name='设备名称')),
                ('device_type', models.CharField(max_length=50, verbose_name='设备类型')),
                ('latitude', models.FloatField(blank=True, null=True, verbose_name='经度')),
                ('longitude', models.FloatField(blank=True, null=True, verbose_name='纬度')),
                ('address', models.CharField(blank=True, max_length=50, null=True, verbose_name='Install Address')),
                ('battery_life', models.IntegerField(default=100, verbose_name='电量(%)')),
                ('online', models.NullBooleanField(default=None, verbose_name='在线状态')),
                ('parent_gateway_mac', models.CharField(blank=True, max_length=50, null=True)),
                ('parent_rtu_mac', models.CharField(blank=True, max_length=50, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TemperatureRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('high', models.FloatField()),
                ('low', models.FloatField()),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now)),
            ],
        ),
        migrations.AddField(
            model_name='datarecord',
            name='device',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pages.Device'),
        ),
    ]
