# Generated by Django 3.2.1 on 2021-05-10 18:46

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.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('land', models.IntegerField()),
                ('address', models.TextField()),
                ('year', models.IntegerField()),
                ('material', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='CardModel',
            fields=[
                ('id', models.CharField(max_length=256, primary_key=True, serialize=False)),
                ('description', models.TextField()),
                ('root', models.CharField(max_length=30)),
                ('name', models.CharField(max_length=30)),
            ],
        ),
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('boss', models.CharField(max_length=40)),
                ('phone', models.CharField(max_length=10)),
                ('office_dean', models.CharField(max_length=30)),
                ('start_date', models.DateField()),
                ('type', models.CharField(max_length=20)),
                ('building', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.building')),
            ],
        ),
        migrations.CreateModel(
            name='Hall',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('code', models.IntegerField()),
                ('square', models.IntegerField(null=True)),
                ('window', models.IntegerField(null=True)),
                ('heating', models.IntegerField(null=True)),
                ('target', models.CharField(max_length=15)),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.department')),
            ],
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('standard_code', models.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Worker',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service_number', models.IntegerField()),
                ('address', models.CharField(max_length=100)),
                ('name', models.CharField(max_length=100)),
                ('phone', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Unit',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=30)),
                ('date_start', models.DateField()),
                ('cost', models.IntegerField()),
                ('period', models.IntegerField()),
                ('standard_code', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.property')),
            ],
        ),
        migrations.CreateModel(
            name='Revaluation',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('date', models.DateField()),
                ('cost_after', models.IntegerField()),
                ('cost_before', models.IntegerField()),
                ('unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.unit')),
            ],
        ),
        migrations.CreateModel(
            name='Responsibility',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('start_date', models.DateField()),
                ('end_date', models.DateField(null=True)),
                ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.hall')),
                ('worker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.worker')),
            ],
        ),
        migrations.CreateModel(
            name='Management',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('start_date', models.DateField()),
                ('end_date', models.DateField(null=True)),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.department')),
                ('worker', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.worker')),
            ],
        ),
        migrations.CreateModel(
            name='Consist',
            fields=[
                ('id', models.IntegerField(auto_created=True, primary_key=True, serialize=False)),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.hall')),
                ('unit', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='registry.unit')),
            ],
        ),
    ]
