# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-17 15:03
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Entity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('display_name', models.CharField(max_length=200)),
                ('description', models.CharField(blank=True, max_length=200, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='EnumerationChoice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Asset',
            fields=[
                ('entity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='visaweb.Entity')),
                ('alias', models.CharField(blank=True, default=None, max_length=200, null=True)),
                ('address', models.CharField(max_length=200)),
            ],
            bases=('visaweb.entity',),
        ),
        migrations.CreateModel(
            name='EnumerationType',
            fields=[
                ('entity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='visaweb.Entity')),
            ],
            bases=('visaweb.entity',),
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('entity_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='visaweb.Entity')),
                ('name', models.CharField(max_length=200)),
                ('type', models.CharField(choices=[('string', 'string'), ('interval', 'interval'), ('choice', 'choice')], default='string', max_length=200)),
            ],
            bases=('visaweb.entity',),
        ),
        migrations.CreateModel(
            name='ChoiceProperty',
            fields=[
                ('property_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='visaweb.Property')),
            ],
            bases=('visaweb.property',),
        ),
        migrations.CreateModel(
            name='IntervalProperty',
            fields=[
                ('property_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='visaweb.Property')),
                ('minimum', models.FloatField()),
                ('maximum', models.FloatField()),
                ('default_value', models.FloatField()),
            ],
            bases=('visaweb.property',),
        ),
        migrations.CreateModel(
            name='StringProperty',
            fields=[
                ('property_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='visaweb.Property')),
                ('default_value', models.CharField(blank=True, max_length=200, null=True)),
            ],
            bases=('visaweb.property',),
        ),
        migrations.AddField(
            model_name='property',
            name='default_unit',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='visaweb.EnumerationChoice'),
        ),
        migrations.AddField(
            model_name='property',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='properties', to='visaweb.Asset'),
        ),
        migrations.AddField(
            model_name='property',
            name='unit_choices',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='visaweb.EnumerationType'),
        ),
        migrations.AddField(
            model_name='enumerationchoice',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='visaweb.EnumerationType'),
        ),
        migrations.AddField(
            model_name='choiceproperty',
            name='default_value',
            field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='visaweb.EnumerationChoice'),
        ),
        migrations.AddField(
            model_name='choiceproperty',
            name='value_choices',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='visaweb.EnumerationType'),
        ),
    ]
