# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2019-01-31 09:42
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion
import mptt.fields
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('glossary', '0004_academicgroup_dekid'),
    ]

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('deleted', models.BooleanField(default=False)),
                ('name', models.TextField(verbose_name='Адрес')),
                ('longitude', models.FloatField(blank=True, null=True, verbose_name='Долгота')),
                ('latitude', models.FloatField(blank=True, null=True, verbose_name='Широта')),
            ],
            options={
                'verbose_name': 'Адрес',
                'verbose_name_plural': 'Адреса',
            },
        ),
        migrations.CreateModel(
            name='Campus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('deleted', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500, verbose_name='Наименование')),
                ('address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='glossary.Address', verbose_name='Адрес')),
            ],
            options={
                'verbose_name': 'Здание',
                'verbose_name_plural': 'Здания',
            },
        ),
        migrations.CreateModel(
            name='Room',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('deleted', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500, verbose_name='Наименование/номер')),
                ('description', models.TextField(blank=True, verbose_name='Описание')),
                ('places', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='Количество посадочных мест')),
                ('size', models.FloatField(blank=True, null=True, verbose_name='Площадь')),
                ('floor', models.PositiveSmallIntegerField(blank=True, choices=[(0, 0), (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6), (7, 7), (8, 8), (9, 9)], null=True, verbose_name='Этаж')),
            ],
            options={
                'verbose_name': 'Тип помещения',
                'verbose_name_plural': 'Тип помещений',
            },
        ),
        migrations.CreateModel(
            name='RoomType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('deleted', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500, verbose_name='Тип')),
            ],
            options={
                'verbose_name': 'Тип помещения',
                'verbose_name_plural': 'Тип помещений',
            },
        ),
        migrations.CreateModel(
            name='Subdivision',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('deleted', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=500, verbose_name='Наименование')),
                ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(db_index=True, editable=False)),
                ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='glossary.Subdivision')),
            ],
            options={
                'verbose_name': 'Подразделение',
                'verbose_name_plural': 'Подразделения',
            },
        ),
        migrations.AddField(
            model_name='room',
            name='subdivisions',
            field=models.ManyToManyField(blank=True, to='glossary.Subdivision', verbose_name='Подразделения'),
        ),
        migrations.AddField(
            model_name='room',
            name='type',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='glossary.RoomType', verbose_name='Тип помещения'),
        ),
    ]
