# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-05-11 07:14
from __future__ import unicode_literals

import c3nav.mapdata.fields
import c3nav.mapdata.models.locations
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Building',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='polygon')),
            ],
            options={
                'verbose_name': 'Building',
                'verbose_name_plural': 'Buildings',
                'default_related_name': 'buildings',
            },
        ),
        migrations.CreateModel(
            name='Door',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('level', models.CharField(choices=[('', 'normal'), ('upper', 'upper'), ('lower', 'lower')], default='', max_length=16, verbose_name='level')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='polygon')),
            ],
            options={
                'verbose_name': 'Door',
                'verbose_name_plural': 'Doors',
                'default_related_name': 'doors',
            },
        ),
        migrations.CreateModel(
            name='Hole',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='polygon')),
            ],
            options={
                'verbose_name': 'Hole',
                'verbose_name_plural': 'Holes',
                'default_related_name': 'holes',
            },
        ),
        migrations.CreateModel(
            name='LineObstacle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='linestring')),
                ('width', models.DecimalField(decimal_places=2, default=0.15, max_digits=4, verbose_name='obstacle width')),
            ],
            options={
                'verbose_name': 'Line Obstacle',
                'verbose_name_plural': 'Line Obstacles',
                'default_related_name': 'lineobstacles',
            },
        ),
        migrations.CreateModel(
            name='LocationSlug',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(null=True, unique=True, verbose_name='name')),
            ],
            options={
                'verbose_name': 'Slug for Location',
                'verbose_name_plural': 'Slugs für Locations',
                'default_related_name': 'locationslugs',
            },
        ),
        migrations.CreateModel(
            name='Obstacle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='polygon')),
            ],
            options={
                'verbose_name': 'Obstacle',
                'verbose_name_plural': 'Obstacles',
                'default_related_name': 'obstacles',
            },
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.SlugField(unique=True, verbose_name='Name')),
                ('bottom', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='bottom coordinate')),
                ('left', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='left coordinate')),
                ('top', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='top coordinate')),
                ('right', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='right coordinate')),
                ('image', models.BinaryField(verbose_name='image data')),
            ],
            options={
                'verbose_name': 'Source',
                'verbose_name_plural': 'Sources',
                'default_related_name': 'sources',
            },
        ),
        migrations.CreateModel(
            name='Stair',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='linestring')),
            ],
            options={
                'verbose_name': 'Stair',
                'verbose_name_plural': 'Stairs',
                'default_related_name': 'stairs',
            },
        ),
        migrations.CreateModel(
            name='Area',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='areas', serialize=False, to='mapdata.LocationSlug')),
                ('titles', c3nav.mapdata.fields.JSONField(default={})),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can be used to describe a position')),
                ('color', models.CharField(blank=True, help_text='if set, has to be a valid color for svg images', max_length=16, null=True, verbose_name='background color')),
                ('public', models.BooleanField(default=True, verbose_name='public')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='polygon')),
                ('stuffed', models.BooleanField(default=False, verbose_name='stuffed area')),
            ],
            options={
                'verbose_name': 'Area',
                'verbose_name_plural': 'Areas',
                'default_related_name': 'areas',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
        migrations.CreateModel(
            name='LocationGroup',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='locationgroups', serialize=False, to='mapdata.LocationSlug')),
                ('titles', c3nav.mapdata.fields.JSONField(default={})),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can be used to describe a position')),
                ('color', models.CharField(blank=True, help_text='if set, has to be a valid color for svg images', max_length=16, null=True, verbose_name='background color')),
                ('public', models.BooleanField(default=True, verbose_name='public')),
                ('compiled_room', models.BooleanField(default=False, verbose_name='is a compiled room')),
                ('compiled_area', models.BooleanField(default=False, verbose_name='is a compiled area')),
            ],
            options={
                'verbose_name': 'Location Group',
                'verbose_name_plural': 'Location Groups',
                'default_related_name': 'locationgroups',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
        migrations.CreateModel(
            name='Point',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='points', serialize=False, to='mapdata.LocationSlug')),
                ('titles', c3nav.mapdata.fields.JSONField(default={})),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can be used to describe a position')),
                ('color', models.CharField(blank=True, help_text='if set, has to be a valid color for svg images', max_length=16, null=True, verbose_name='background color')),
                ('public', models.BooleanField(default=True, verbose_name='public')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='point')),
                ('groups', models.ManyToManyField(blank=True, related_name='points', to='mapdata.LocationGroup', verbose_name='Location Groups')),
            ],
            options={
                'verbose_name': 'Point',
                'verbose_name_plural': 'Points',
                'default_related_name': 'points',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='sections', serialize=False, to='mapdata.LocationSlug')),
                ('titles', c3nav.mapdata.fields.JSONField(default={})),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can be used to describe a position')),
                ('color', models.CharField(blank=True, help_text='if set, has to be a valid color for svg images', max_length=16, null=True, verbose_name='background color')),
                ('public', models.BooleanField(default=True, verbose_name='public')),
                ('name', models.SlugField(unique=True, verbose_name='section name')),
                ('altitude', models.DecimalField(decimal_places=2, max_digits=6, unique=True, verbose_name='section altitude')),
                ('groups', models.ManyToManyField(blank=True, related_name='sections', to='mapdata.LocationGroup', verbose_name='Location Groups')),
            ],
            options={
                'verbose_name': 'Section',
                'verbose_name_plural': 'Sections',
                'ordering': ['altitude'],
                'default_related_name': 'sections',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
        migrations.CreateModel(
            name='Space',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='spaces', serialize=False, to='mapdata.LocationSlug')),
                ('titles', c3nav.mapdata.fields.JSONField(default={})),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can be used to describe a position')),
                ('color', models.CharField(blank=True, help_text='if set, has to be a valid color for svg images', max_length=16, null=True, verbose_name='background color')),
                ('level', models.CharField(choices=[('', 'normal'), ('upper', 'upper'), ('lower', 'lower')], default='', max_length=16, verbose_name='level')),
                ('geometry', c3nav.mapdata.fields.GeometryField(geomtype='polygon')),
                ('public', models.BooleanField(default=True, verbose_name='public')),
                ('category', models.CharField(choices=[('', 'normal'), ('stairs', 'stairs'), ('escalator', 'escalator'), ('elevator', 'elevator')], default='', max_length=16, verbose_name='category')),
                ('groups', models.ManyToManyField(blank=True, related_name='spaces', to='mapdata.LocationGroup', verbose_name='Location Groups')),
                ('section', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='spaces', to='mapdata.Section', verbose_name='section')),
            ],
            options={
                'verbose_name': 'Space',
                'verbose_name_plural': 'Spaces',
                'default_related_name': 'spaces',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
        migrations.AddField(
            model_name='stair',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='stairs', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='point',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='points', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='obstacle',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='obstacles', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='lineobstacle',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lineobstacles', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='hole',
            name='section',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='holes', to='mapdata.Section', verbose_name='section'),
        ),
        migrations.AddField(
            model_name='door',
            name='section',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='doors', to='mapdata.Section', verbose_name='section'),
        ),
        migrations.AddField(
            model_name='building',
            name='section',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='buildings', to='mapdata.Section', verbose_name='section'),
        ),
        migrations.AddField(
            model_name='area',
            name='groups',
            field=models.ManyToManyField(blank=True, related_name='areas', to='mapdata.LocationGroup', verbose_name='Location Groups'),
        ),
        migrations.AddField(
            model_name='area',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='areas', to='mapdata.Space', verbose_name='space'),
        ),
    ]
