# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-11 12:06
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    dependencies = [
        ('mapdata', '0011_outside_only_outside'),
    ]

    operations = [
        migrations.RenameModel(
            old_name='Section',
            new_name='Level',
        ),
        migrations.AlterModelOptions(
            name='level',
            options={'ordering': ['altitude'], 'verbose_name': 'Level', 'verbose_name_plural': 'Levels'},
        ),
        migrations.RenameField(
            model_name='building',
            old_name='section',
            new_name='level',
        ),
        migrations.RenameField(
            model_name='door',
            old_name='section',
            new_name='level',
        ),
        migrations.RenameField(
            model_name='space',
            old_name='section',
            new_name='level',
        ),
        migrations.AlterField(
            model_name='level',
            name='altitude',
            field=models.DecimalField(decimal_places=2, max_digits=6, unique=True, verbose_name='level altitude'),
        ),
        migrations.AlterField(
            model_name='level',
            name='groups',
            field=models.ManyToManyField(blank=True, related_name='levels', to='mapdata.LocationGroup',
                                         verbose_name='Location Groups'),
        ),
        migrations.AlterField(
            model_name='level',
            name='locationslug_ptr',
            field=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'),
        ),
        migrations.AlterField(
            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.AlterField(
            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.AlterField(
            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.AlterField(
            model_name='space',
            name='level',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='spaces',
                                    to='mapdata.Level', verbose_name='level'),
        ),
    ]

    # workaround as transactions are not supported on SQLite because they would break referential integrity
    atomic = settings.DATABASES['default']['ENGINE'] != 'django.db.backends.sqlite3'
