# Generated by Django 2.1.1 on 2018-12-07 18:38

import c3nav.mapdata.fields
import c3nav.mapdata.models.access
from decimal import Decimal
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    replaces = [('mapdata', '0001_squashed_refactor_2017'), ('mapdata', '0002_locationredirect'), ('mapdata', '0003_space_outside'), ('mapdata', '0004_space_level_category_name'), ('mapdata', '0005_auto_20170527_1556'), ('mapdata', '0006_remove_section_name'), ('mapdata', '0007_assign_hole_space'), ('mapdata', '0008_auto_20170608_1317'), ('mapdata', '0009_column'), ('mapdata', '0010_on_top_of'), ('mapdata', '0011_outside_only_outside'), ('mapdata', '0012_rename_section_to_level'), ('mapdata', '0013_auto_20170618_1934'), ('mapdata', '0014_mapupdate'), ('mapdata', '0015_auto_20170706_1334'), ('mapdata', '0016_remove_source_image'), ('mapdata', '0017_point_to_poi'), ('mapdata', '0018_auto_20170708_1752'), ('mapdata', '0019_location_group_category'), ('mapdata', '0020_auto_20170710_1848'), ('mapdata', '0021_auto_20170710_1916'), ('mapdata', '0022_remove_space_category'), ('mapdata', '0023_auto_20170711_1741'), ('mapdata', '0024_remove_compiled_room_area'), ('mapdata', '0025_remove_area_stuffed'), ('mapdata', '0026_remove_specificlocation_color'), ('mapdata', '0027_access_restriction'), ('mapdata', '0028_door_access_restriction'), ('mapdata', '0029_auto_20170714_1519'), ('mapdata', '0030_altitudes'), ('mapdata', '0031_auto_20170805_1647'), ('mapdata', '0032_remove_graphnode_space_transfer'), ('mapdata', '0033_auto_20170807_1423'), ('mapdata', '0034_auto_20170807_1523'), ('mapdata', '0035_auto_20170916_1216'), ('mapdata', '0036_geometry_bounds'), ('mapdata', '0037_level_geoms_cache'), ('mapdata', '0038_level_render_data'), ('mapdata', '0039_auto_20171024_2011'), ('mapdata', '0040_access_permissions'), ('mapdata', '0041_level_short_label'), ('mapdata', '0042_auto_20171031_1507'), ('mapdata', '0043_auto_20171110_1451'), ('mapdata', '0044_mapupdate_processed'), ('mapdata', '0045_level_door_height'), ('mapdata', '0046_remove_level_render_data'), ('mapdata', '0047_remove_mapupdate_changed_geometries'), ('mapdata', '0048_ramp'), ('mapdata', '0049_altitude_area_ramp'), ('mapdata', '0050_remove_geometry_bounds'), ('mapdata', '0051_auto_20171125_1241'), ('mapdata', '0052_auto_20171125_1335'), ('mapdata', '0053_i18nfield'), ('mapdata', '0054_title_plural'), ('mapdata', '0055_grant_access_permissions'), ('mapdata', '0056_accesspermissiontoken'), ('mapdata', '0057_waytype_fields'), ('mapdata', '0058_wifimeasurement'), ('mapdata', '0059_multiple_accesspermissions'), ('mapdata', '0060_access_permission_id'), ('mapdata', '0061_space_based_route_descriptions'), ('mapdata', '0062_typos'), ('mapdata', '0063_descriptions_unique_together'), ('mapdata', '0064_access_permission_unique_key'), ('mapdata', '0065_access_restriction_group'), ('mapdata', '0066_area_slow_down_factor'), ('mapdata', '0067_space_enter_description'), ('mapdata', '0068_waytype_level_change_description'), ('mapdata', '0069_mapupdate_geometries_changed'), ('mapdata', '0070_auto_20180918_1736'), ('mapdata', '0071_space_base_mapdata_accessible')]

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AccessPermission',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('expire_date', models.DateTimeField(null=True, verbose_name='expires')),
                ('can_grant', models.BooleanField(default=False, verbose_name='can grant')),
                ('unique_key', models.CharField(max_length=32, null=True, verbose_name='unique key')),
            ],
            options={
                'verbose_name': 'Access Permission',
                'verbose_name_plural': 'Access Permissions',
                'default_related_name': 'accesspermissions',
            },
        ),
        migrations.CreateModel(
            name='AccessPermissionToken',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('valid_until', models.DateTimeField(db_index=True, default=c3nav.mapdata.models.access.default_valid_until, verbose_name='valid until')),
                ('unlimited', models.BooleanField(db_index=True, default=False, verbose_name='unlimited')),
                ('redeemed', models.BooleanField(db_index=True, default=False, verbose_name='redeemed')),
                ('can_grant', models.BooleanField(db_index=True, default=False, verbose_name='can grant')),
                ('unique_key', models.CharField(max_length=32, null=True, verbose_name='unique key')),
                ('data', models.BinaryField()),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='created_accesspermission_tokens', to=settings.AUTH_USER_MODEL, verbose_name='author')),
            ],
            options={
                'verbose_name': 'Access Permission Token',
                'verbose_name_plural': 'Access Permission Tokens',
                'default_related_name': 'accessrestriction_tokens',
            },
        ),
        migrations.CreateModel(
            name='AccessRestriction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, fallback_value='{model} {pk}', plural_name='titles', verbose_name='Title')),
                ('open', models.BooleanField(default=False, verbose_name='open')),
            ],
            options={
                'verbose_name': 'Access Restriction',
                'verbose_name_plural': 'Access Restrictions',
                'default_related_name': 'accessrestrictions',
            },
        ),
        migrations.CreateModel(
            name='AccessRestrictionGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, fallback_value='{model} {pk}', plural_name='titles', verbose_name='Title')),
            ],
            options={
                'verbose_name': 'Access Restriction Group',
                'verbose_name_plural': 'Access Restriction Groups',
                'default_related_name': 'accessrestrictiongroups',
            },
        ),
        migrations.CreateModel(
            name='AltitudeArea',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='multipolygon')),
                ('altitude', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='altitude')),
                ('altitude2', models.DecimalField(decimal_places=2, max_digits=6, null=True, verbose_name='second altitude')),
                ('point1', c3nav.mapdata.fields.GeometryField(default=None, geomtype='point', null=True)),
                ('point2', c3nav.mapdata.fields.GeometryField(default=None, geomtype='point', null=True)),
            ],
            options={
                'verbose_name': 'Altitude Area',
                'verbose_name_plural': 'Altitude Areas',
                'ordering': ('altitude',),
                'default_related_name': 'altitudeareas',
            },
        ),
        migrations.CreateModel(
            name='AltitudeMarker',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='point')),
                ('altitude', models.DecimalField(decimal_places=2, max_digits=6, verbose_name='altitude')),
            ],
            options={
                'verbose_name': 'Altitude Marker',
                'verbose_name_plural': 'Altitude Markers',
                'default_related_name': 'altitudemarkers',
            },
        ),
        migrations.CreateModel(
            name='Building',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='polygon')),
            ],
            options={
                'verbose_name': 'Building',
                'verbose_name_plural': 'Buildings',
                'default_related_name': 'buildings',
            },
        ),
        migrations.CreateModel(
            name='Column',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='polygon')),
            ],
            options={
                'verbose_name': 'Column',
                'verbose_name_plural': 'Columns',
                'default_related_name': 'columns',
            },
        ),
        migrations.CreateModel(
            name='CrossDescription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', c3nav.mapdata.fields.I18nField(verbose_name='description')),
            ],
            options={
                'verbose_name': 'Cross description',
                'verbose_name_plural': 'Cross descriptions',
                'default_related_name': 'cross_descriptions',
            },
        ),
        migrations.CreateModel(
            name='Door',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='polygon')),
                ('access_restriction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='doors', to='mapdata.AccessRestriction', verbose_name='Access Restriction')),
            ],
            options={
                'verbose_name': 'Door',
                'verbose_name_plural': 'Doors',
                'default_related_name': 'doors',
            },
        ),
        migrations.CreateModel(
            name='GraphEdge',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('access_restriction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='graphedges', to='mapdata.AccessRestriction', verbose_name='Access Restriction')),
            ],
            options={
                'verbose_name': 'Graph Edge',
                'verbose_name_plural': 'Graph Edges',
                'default_related_name': 'graphedges',
            },
        ),
        migrations.CreateModel(
            name='GraphNode',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='point')),
            ],
            options={
                'verbose_name': 'Graph Node',
                'verbose_name_plural': 'Graph Nodes',
                'default_related_name': 'graphnodes',
            },
        ),
        migrations.CreateModel(
            name='Hole',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='polygon')),
            ],
            options={
                'verbose_name': 'Hole',
                'verbose_name_plural': 'Holes',
                'default_related_name': 'holes',
            },
        ),
        migrations.CreateModel(
            name='LeaveDescription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('description', c3nav.mapdata.fields.I18nField(verbose_name='description')),
            ],
            options={
                'verbose_name': 'Leave description',
                'verbose_name_plural': 'Leave descriptions',
                'default_related_name': 'leave_descriptions',
            },
        ),
        migrations.CreateModel(
            name='LineObstacle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='linestring')),
                ('width', models.DecimalField(decimal_places=2, default=0.15, max_digits=4, verbose_name='width')),
                ('height', models.DecimalField(decimal_places=2, default=0.8, max_digits=6, validators=[django.core.validators.MinValueValidator(Decimal('0'))], verbose_name='height')),
            ],
            options={
                'verbose_name': 'Line Obstacle',
                'verbose_name_plural': 'Line Obstacles',
                'default_related_name': 'lineobstacles',
            },
        ),
        migrations.CreateModel(
            name='LocationGroupCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.SlugField(unique=True, verbose_name='Name')),
                ('single', models.BooleanField(default=False, verbose_name='single selection')),
                ('title', c3nav.mapdata.fields.I18nField(fallback_any=True, plural_name='titles', verbose_name='Title')),
                ('title_plural', c3nav.mapdata.fields.I18nField(fallback_any=True, plural_name='titles_plural', verbose_name='Title (Plural)')),
                ('allow_levels', models.BooleanField(db_index=True, default=True, verbose_name='allow levels')),
                ('allow_spaces', models.BooleanField(db_index=True, default=True, verbose_name='allow spaces')),
                ('allow_areas', models.BooleanField(db_index=True, default=True, verbose_name='allow areas')),
                ('allow_pois', models.BooleanField(db_index=True, default=True, verbose_name='allow pois')),
                ('priority', models.IntegerField(db_index=True, default=0)),
            ],
            options={
                'verbose_name': 'Location Group Category',
                'verbose_name_plural': 'Location Group Categories',
                'ordering': ('-priority',),
                'default_related_name': 'locationgroupcategories',
            },
        ),
        migrations.CreateModel(
            name='LocationSlug',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(blank=True, null=True, unique=True, verbose_name='Slug')),
            ],
            options={
                'verbose_name': 'Location with Slug',
                'verbose_name_plural': 'Location with Slug',
                'default_related_name': 'locationslugs',
            },
        ),
        migrations.CreateModel(
            name='MapUpdate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('datetime', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('type', models.CharField(max_length=32)),
                ('processed', models.BooleanField(default=False)),
                ('geometries_changed', models.BooleanField()),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='mapupdates', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Map update',
                'verbose_name_plural': 'Map updates',
                'get_latest_by': 'datetime',
                'default_related_name': 'mapupdates',
            },
        ),
        migrations.CreateModel(
            name='Obstacle',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='polygon')),
                ('height', models.DecimalField(decimal_places=2, default=0.8, max_digits=6, validators=[django.core.validators.MinValueValidator(Decimal('0'))], verbose_name='height')),
            ],
            options={
                'verbose_name': 'Obstacle',
                'verbose_name_plural': 'Obstacles',
                'default_related_name': 'obstacles',
            },
        ),
        migrations.CreateModel(
            name='Ramp',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='polygon')),
            ],
            options={
                'verbose_name': 'Ramp',
                'verbose_name_plural': 'Ramps',
                'default_related_name': 'ramps',
            },
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('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')),
                ('name', models.CharField(max_length=50, unique=True, verbose_name='Name')),
                ('access_restriction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='sources', to='mapdata.AccessRestriction', verbose_name='Access Restriction')),
            ],
            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(default=None, geomtype='linestring')),
            ],
            options={
                'verbose_name': 'Stair',
                'verbose_name_plural': 'Stairs',
                'default_related_name': 'stairs',
            },
        ),
        migrations.CreateModel(
            name='WayType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', c3nav.mapdata.fields.I18nField(fallback_any=True, plural_name='titles', verbose_name='Title')),
                ('title_plural', c3nav.mapdata.fields.I18nField(fallback_any=True, plural_name='titles_plural', verbose_name='Title (Plural)')),
                ('join_edges', models.BooleanField(default=True, verbose_name='join consecutive edges')),
                ('up_separate', models.BooleanField(default=True, verbose_name='upwards separately')),
                ('walk', models.BooleanField(default=False, verbose_name='walking')),
                ('color', models.CharField(max_length=32, verbose_name='edge color')),
                ('icon_name', models.CharField(blank=True, max_length=32, null=True, verbose_name='icon name')),
                ('extra_seconds', models.PositiveSmallIntegerField(default=0, verbose_name='extra seconds per edge')),
                ('speed', models.DecimalField(decimal_places=1, default=1, max_digits=3, validators=[django.core.validators.MinValueValidator(Decimal('0.1'))], verbose_name='speed (m/s)')),
                ('description', c3nav.mapdata.fields.I18nField(fallback_any=True, verbose_name='description')),
                ('speed_up', models.DecimalField(decimal_places=1, default=1, max_digits=3, validators=[django.core.validators.MinValueValidator(Decimal('0.1'))], verbose_name='speed upwards (m/s)')),
                ('description_up', c3nav.mapdata.fields.I18nField(fallback_any=True, verbose_name='description upwards')),
                ('level_change_description', c3nav.mapdata.fields.I18nField(verbose_name='level change description')),
            ],
            options={
                'verbose_name': 'Way Type',
                'verbose_name_plural': 'Way Types',
                'default_related_name': 'waytypes',
            },
        ),
        migrations.CreateModel(
            name='WifiMeasurement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='point')),
                ('comment', models.TextField(blank=True, null=True, verbose_name='comment')),
                ('data', c3nav.mapdata.fields.JSONField(verbose_name='Measurement list')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='wifi_measurements', to=settings.AUTH_USER_MODEL, verbose_name='author')),
            ],
            options={
                'verbose_name': 'Wi-Fi Measurement',
                'verbose_name_plural': 'Wi-Fi Measurements',
                'default_related_name': 'wifi_measurements',
            },
        ),
        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')),
                ('title', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, fallback_value='{model} {pk}', plural_name='titles', verbose_name='Title')),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can describe')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='polygon')),
                ('slow_down_factor', models.DecimalField(decimal_places=2, default=1, max_digits=6, validators=[django.core.validators.MinValueValidator(Decimal('0.01'))], verbose_name='slow down factor')),
            ],
            options={
                'verbose_name': 'Area',
                'verbose_name_plural': 'Areas',
                'default_related_name': 'areas',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
        migrations.CreateModel(
            name='Level',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='levels', serialize=False, to='mapdata.LocationSlug')),
                ('title', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, fallback_value='{model} {pk}', plural_name='titles', verbose_name='Title')),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can describe')),
                ('base_altitude', models.DecimalField(decimal_places=2, max_digits=6, unique=True, verbose_name='base altitude')),
                ('default_height', models.DecimalField(decimal_places=2, default=3.0, max_digits=6, validators=[django.core.validators.MinValueValidator(Decimal('0'))], verbose_name='default space height')),
                ('door_height', models.DecimalField(decimal_places=2, default=2.0, max_digits=6, validators=[django.core.validators.MinValueValidator(Decimal('0'))], verbose_name='door height')),
                ('short_label', models.SlugField(max_length=20, unique=True, verbose_name='short label')),
            ],
            options={
                'verbose_name': 'Level',
                'verbose_name_plural': 'Levels',
                'ordering': ['base_altitude'],
                'default_related_name': 'levels',
            },
            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')),
                ('title', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, fallback_value='{model} {pk}', plural_name='titles', verbose_name='Title')),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can describe')),
                ('priority', models.IntegerField(db_index=True, default=0)),
                ('color', models.CharField(blank=True, max_length=32, null=True, verbose_name='background color')),
            ],
            options={
                'verbose_name': 'Location Group',
                'verbose_name_plural': 'Location Groups',
                'ordering': ('-category__priority', '-priority'),
                'default_related_name': 'locationgroups',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
        migrations.CreateModel(
            name='LocationRedirect',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='redirect', serialize=False, to='mapdata.LocationSlug')),
            ],
            options={
                'default_related_name': 'redirect',
            },
            bases=('mapdata.locationslug',),
        ),
        migrations.CreateModel(
            name='POI',
            fields=[
                ('locationslug_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='pois', serialize=False, to='mapdata.LocationSlug')),
                ('title', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, fallback_value='{model} {pk}', plural_name='titles', verbose_name='Title')),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can describe')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='point')),
            ],
            options={
                'verbose_name': 'Point of Interest',
                'verbose_name_plural': 'Points of Interest',
                'default_related_name': 'pois',
            },
            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')),
                ('title', c3nav.mapdata.fields.I18nField(blank=True, fallback_any=True, fallback_value='{model} {pk}', plural_name='titles', verbose_name='Title')),
                ('can_search', models.BooleanField(default=True, verbose_name='can be searched')),
                ('can_describe', models.BooleanField(default=True, verbose_name='can describe')),
                ('geometry', c3nav.mapdata.fields.GeometryField(default=None, geomtype='polygon')),
                ('height', models.DecimalField(blank=True, decimal_places=2, max_digits=6, null=True, validators=[django.core.validators.MinValueValidator(Decimal('0'))], verbose_name='height')),
                ('outside', models.BooleanField(default=False, verbose_name='only outside of building')),
                ('enter_description', c3nav.mapdata.fields.I18nField(blank=True, fallback_language=None, verbose_name='Enter description')),
                ('base_mapdata_accessible', models.BooleanField(default=False, verbose_name='always accessible (overwrites base mapdata setting)')),
            ],
            options={
                'verbose_name': 'Space',
                'verbose_name_plural': 'Spaces',
                'default_related_name': 'spaces',
            },
            bases=('mapdata.locationslug', models.Model),
        ),
        migrations.AddField(
            model_name='graphedge',
            name='from_node',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='edges_from_here', to='mapdata.GraphNode', verbose_name='from node'),
        ),
        migrations.AddField(
            model_name='graphedge',
            name='to_node',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='edges_to_here', to='mapdata.GraphNode', verbose_name='to node'),
        ),
        migrations.AddField(
            model_name='graphedge',
            name='waytype',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='graphedges', to='mapdata.WayType', verbose_name='Way Type'),
        ),
        migrations.AddField(
            model_name='accessrestriction',
            name='groups',
            field=models.ManyToManyField(blank=True, related_name='accessrestrictions', to='mapdata.AccessRestrictionGroup', verbose_name='Groups'),
        ),
        migrations.AddField(
            model_name='accesspermission',
            name='access_restriction',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accesspermissions', to='mapdata.AccessRestriction'),
        ),
        migrations.AddField(
            model_name='accesspermission',
            name='author',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='authored_access_permissions', to=settings.AUTH_USER_MODEL, verbose_name='Author'),
        ),
        migrations.AddField(
            model_name='accesspermission',
            name='token',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='accesspermissions', to='mapdata.AccessPermissionToken', verbose_name='Access permission token'),
        ),
        migrations.AddField(
            model_name='accesspermission',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accesspermissions', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='wifimeasurement',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='wifi_measurements', to='mapdata.Space', verbose_name='space'),
        ),
        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='space',
            name='access_restriction',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='spaces', to='mapdata.AccessRestriction', verbose_name='Access Restriction'),
        ),
        migrations.AddField(
            model_name='space',
            name='groups',
            field=models.ManyToManyField(blank=True, related_name='spaces', to='mapdata.LocationGroup', verbose_name='Location Groups'),
        ),
        migrations.AddField(
            model_name='space',
            name='level',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='spaces', to='mapdata.Level', verbose_name='level'),
        ),
        migrations.AddField(
            model_name='ramp',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ramps', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='poi',
            name='access_restriction',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='pois', to='mapdata.AccessRestriction', verbose_name='Access Restriction'),
        ),
        migrations.AddField(
            model_name='poi',
            name='groups',
            field=models.ManyToManyField(blank=True, related_name='pois', to='mapdata.LocationGroup', verbose_name='Location Groups'),
        ),
        migrations.AddField(
            model_name='poi',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pois', 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='locationredirect',
            name='target',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='redirects', to='mapdata.LocationSlug', verbose_name='target'),
        ),
        migrations.AddField(
            model_name='locationgroup',
            name='access_restriction',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='locationgroups', to='mapdata.AccessRestriction', verbose_name='Access Restriction'),
        ),
        migrations.AddField(
            model_name='locationgroup',
            name='category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='groups', to='mapdata.LocationGroupCategory', verbose_name='Category'),
        ),
        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='level',
            name='access_restriction',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='levels', to='mapdata.AccessRestriction', verbose_name='Access Restriction'),
        ),
        migrations.AddField(
            model_name='level',
            name='groups',
            field=models.ManyToManyField(blank=True, related_name='levels', to='mapdata.LocationGroup', verbose_name='Location Groups'),
        ),
        migrations.AddField(
            model_name='level',
            name='on_top_of',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='levels_on_top', to='mapdata.Level', verbose_name='on top of'),
        ),
        migrations.AddField(
            model_name='leavedescription',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_descriptions', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='leavedescription',
            name='target_space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='enter_descriptions', to='mapdata.Space', verbose_name='target space'),
        ),
        migrations.AddField(
            model_name='hole',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='holes', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='graphnode',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='graphnodes', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AlterUniqueTogether(
            name='graphedge',
            unique_together={('from_node', 'to_node')},
        ),
        migrations.AddField(
            model_name='door',
            name='level',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='doors', to='mapdata.Level', verbose_name='level'),
        ),
        migrations.AddField(
            model_name='crossdescription',
            name='origin_space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_cross_descriptions', to='mapdata.Space', verbose_name='origin space'),
        ),
        migrations.AddField(
            model_name='crossdescription',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cross_descriptions', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='crossdescription',
            name='target_space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cross_enter_descriptions', to='mapdata.Space', verbose_name='target space'),
        ),
        migrations.AddField(
            model_name='column',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='columns', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='building',
            name='level',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='buildings', to='mapdata.Level', verbose_name='level'),
        ),
        migrations.AddField(
            model_name='area',
            name='access_restriction',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='areas', to='mapdata.AccessRestriction', verbose_name='Access Restriction'),
        ),
        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'),
        ),
        migrations.AddField(
            model_name='altitudemarker',
            name='space',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='altitudemarkers', to='mapdata.Space', verbose_name='space'),
        ),
        migrations.AddField(
            model_name='altitudearea',
            name='level',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='altitudeareas', to='mapdata.Level', verbose_name='level'),
        ),
        migrations.AlterUniqueTogether(
            name='accesspermission',
            unique_together={('author', 'unique_key')},
        ),
        migrations.AlterUniqueTogether(
            name='leavedescription',
            unique_together={('space', 'target_space')},
        ),
        migrations.AlterUniqueTogether(
            name='crossdescription',
            unique_together={('space', 'origin_space', 'target_space')},
        ),
    ]
