# Generated by Django 3.2.7 on 2021-09-30 15:46

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Apiary',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, help_text='The name of the apiary', max_length=50)),
                ('address', models.CharField(blank=True, help_text='The address of the apiary', max_length=100)),
                ('city', models.CharField(blank=True, help_text='The city where the apiary is located', max_length=20)),
                ('longitude', models.DecimalField(decimal_places=6, help_text='The apiary longitude value', max_digits=9)),
                ('latitude', models.DecimalField(decimal_places=6, help_text='The apiary latitude value', max_digits=9)),
            ],
        ),
        migrations.CreateModel(
            name='Hive',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='The name of the hive', max_length=50)),
                ('apiary', models.ForeignKey(help_text='The apiary where the hive is located', on_delete=django.db.models.deletion.CASCADE, related_name='hives', to='bees.apiary')),
            ],
        ),
        migrations.CreateModel(
            name='Device',
            fields=[
                ('serial', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Device serial number', primary_key=True, serialize=False)),
                ('is_on', models.BooleanField(default=False, help_text='Whether the device is ON or OFF')),
                ('status', models.CharField(choices=[('OK', 'Device status is ok'), ('WARN', 'Device status is warning'), ('ERR', 'Device status is error'), ('CRIT', 'Device status is critical'), ('UNK', 'Device status is unknown')], default='UNK', help_text='Device status', max_length=5)),
                ('hive', models.OneToOneField(help_text='Hive where the device is located', null=True, on_delete=django.db.models.deletion.SET_NULL, to='bees.hive')),
            ],
        ),
    ]
