# Generated by Django 3.0.4 on 2020-03-28 13:54

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Attribute',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='AttributeThing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', jsonfield.fields.JSONField(null=True)),
                ('attr', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='plan.Attribute')),
            ],
        ),
        migrations.CreateModel(
            name='Layer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
            ],
        ),
        migrations.CreateModel(
            name='Thing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pos_x', models.FloatField(blank=True, null=True)),
                ('pos_y', models.FloatField(blank=True, null=True)),
                ('pos_implicit', models.BooleanField(default=True)),
                ('tag_name', models.CharField(choices=[('zone', 'Zone'), ('object', 'Object')], max_length=16)),
                ('attributes', models.ManyToManyField(through='plan.AttributeThing', to='plan.Attribute')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='plan.Thing')),
                ('pos_layer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='plan.Layer')),
            ],
        ),
        migrations.AddField(
            model_name='attributething',
            name='thing',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='plan.Thing'),
        ),
        migrations.AlterUniqueTogether(
            name='attributething',
            unique_together={('attr', 'thing')},
        ),
    ]
