# Generated by Django 3.2.7 on 2021-09-11 11:58

from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields
import shortuuidfield.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Name', models.CharField(max_length=50)),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='Condition',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Operator', models.IntegerField(choices=[(0, 'Equal'), (1, 'NotEqual'), (2, 'Greater'), (3, 'EqualOrGreater'), (4, 'Smaller'), (5, 'EqualOrSmaller')])),
                ('Value', models.CharField(max_length=50)),
                ('CreatedOn', models.DateTimeField(editable=False)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
                ('AndConditions', models.ManyToManyField(blank=True, to='app.Condition')),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='Prefab',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Name', models.CharField(max_length=50)),
                ('Template', jsonfield.fields.JSONField(default='{}')),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Name', models.CharField(max_length=50)),
                ('CallFunction', models.CharField(max_length=50)),
                ('Parameters', jsonfield.fields.JSONField(default='{}')),
                ('Value', models.CharField(max_length=50)),
                ('Type', models.IntegerField(choices=[(0, 'Error'), (1, 'Read Only'), (2, 'Write Only'), (3, 'Read Or Write'), (4, 'Event')])),
                ('Class', models.IntegerField(choices=[(0, 'Error'), (1, 'Integer'), (2, 'String'), (3, 'Boolean'), (4, 'Color'), (5, 'DayOfWeek'), (6, 'Date'), (7, 'Time'), (8, 'Empty'), (9, 'DateTime')])),
                ('Comparable', models.BooleanField(default=True)),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
                ('Category', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='app.category')),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='PropertyInfo',
            fields=[
                ('property_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.property')),
            ],
            bases=('app.property',),
        ),
        migrations.CreateModel(
            name='Task',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Value', models.CharField(max_length=50)),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
                ('Property', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.DO_NOTHING, to='app.property')),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='Interface',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Name', models.CharField(max_length=50)),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
                ('Editor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='editor', to='app.property')),
                ('Monitor', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='app.property')),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Name', models.CharField(max_length=50)),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
                ('ParentGroup', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='app.group')),
                ('Properties', models.ManyToManyField(blank=True, to='app.Property')),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='Function',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Name', models.CharField(max_length=50)),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
                ('Properties', models.ManyToManyField(blank=True, to='app.Property')),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='Device',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Name', models.CharField(max_length=50)),
                ('CallClass', models.CharField(max_length=50)),
                ('Parameters', jsonfield.fields.JSONField(default='{}')),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
                ('Functions', models.ManyToManyField(blank=True, to='app.Function')),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.CreateModel(
            name='Control',
            fields=[
                ('Id', shortuuidfield.fields.ShortUUIDField(blank=True, editable=False, max_length=22, primary_key=True, serialize=False, unique=True)),
                ('Name', models.CharField(max_length=50)),
                ('CreatedOn', models.DateTimeField(auto_now_add=True)),
                ('ModifiedOn', models.DateTimeField(auto_now_add=True)),
                ('Conditions', models.ManyToManyField(blank=True, to='app.Condition')),
                ('Tasks', models.ManyToManyField(blank=True, to='app.Task')),
            ],
            options={
                'ordering': ['-ModifiedOn'],
            },
        ),
        migrations.AddField(
            model_name='condition',
            name='Property',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.DO_NOTHING, to='app.property'),
        ),
        migrations.CreateModel(
            name='GroupDevice',
            fields=[
                ('device_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='app.device')),
                ('Group', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='app.group')),
            ],
            bases=('app.device',),
        ),
    ]
