# Generated by Django 4.1.1 on 2022-12-06 12:34

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


class Migration(migrations.Migration):

    dependencies = [
        ('main', '0028_rename_сustomer_contracts_customer_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='Grade',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='Звание')),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=50, verbose_name='Должность')),
            ],
        ),
        migrations.AddField(
            model_name='structures',
            name='res_def',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='res_def', to='main.emploees', verbose_name='Ответственный от ДЭиФ'),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='structures',
            name='res_ido',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.PROTECT, related_name='res_ido', to='main.emploees', verbose_name='Ответственный от ИДО'),
            preserve_default=False,
        ),
        migrations.AlterField(
            model_name='structures',
            name='director_ido',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='dir_ido', to='main.emploees', verbose_name='Директор ИДО'),
        ),
        migrations.CreateModel(
            name='Questions',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('body', models.TextField(verbose_name='Вопрос')),
                ('member', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='main.emploees', verbose_name='Член комиссии')),
            ],
            options={
                'verbose_name': 'Вопрос',
                'verbose_name_plural': 'Вопросы',
            },
        ),
        migrations.CreateModel(
            name='Protocols',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.IntegerField(verbose_name='Номер протокола')),
                ('date_time', models.DateTimeField(verbose_name='Дата и время протокола')),
                ('questions', models.ManyToManyField(related_name='Вопросы', to='main.questions')),
            ],
            options={
                'verbose_name': 'Протокол',
                'verbose_name_plural': 'Протоколы',
            },
        ),
        migrations.CreateModel(
            name='Diploms',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='Тема работы')),
                ('adviser', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='main.emploees', verbose_name='Руководитель работы')),
                ('protocol', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='main.protocols', verbose_name='Протокол защиты')),
            ],
            options={
                'verbose_name': 'Диплом',
                'verbose_name_plural': 'Дипломы',
            },
        ),
        migrations.AddField(
            model_name='contracts',
            name='diplom',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='main.diploms', verbose_name='ВКР'),
        ),
        migrations.AddField(
            model_name='emploees',
            name='grade',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='main.grade', verbose_name='Звание'),
        ),
        migrations.AddField(
            model_name='emploees',
            name='post',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='main.post', verbose_name='Должность'),
        ),
    ]
