# Generated by Django 2.2 on 2019-04-04 18:39

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import jsonfield.fields
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('actuator', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='SentHistory',
            fields=[
                ('command_id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Unique UUID of the command', primary_key=True, serialize=False)),
                ('received_on', models.DateTimeField(default=django.utils.timezone.now, help_text='Time the command was received')),
                ('command', jsonfield.fields.JSONField(blank=True, help_text='Command that was received', null=True)),
                ('actuators', models.ManyToManyField(help_text='Actuators the command was sent to', to='actuator.Actuator')),
                ('user', models.ForeignKey(help_text='User that sent the command', on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'Sent History',
            },
        ),
        migrations.CreateModel(
            name='ResponseHistory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('received_on', models.DateTimeField(default=django.utils.timezone.now, help_text='Time the respose was received')),
                ('response', jsonfield.fields.JSONField(blank=True, help_text='Response that was received', null=True)),
                ('actuator', models.ForeignKey(help_text='Actuator response was received from', null=True, on_delete=django.db.models.deletion.PROTECT, to='actuator.Actuator')),
                ('command', models.ForeignKey(help_text='Command that was received', on_delete=django.db.models.deletion.CASCADE, to='command.SentHistory')),
            ],
            options={
                'verbose_name_plural': 'Response History',
            },
        ),
    ]
