# Generated by Django 2.2.13 on 2020-12-17 13:21

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Название секции')),
                ('code', models.CharField(max_length=5, verbose_name='Код секции')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Время добавления')),
            ],
            options={
                'verbose_name': 'Секция',
                'verbose_name_plural': 'Секции',
            },
        ),
        migrations.CreateModel(
            name='Child',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(max_length=100, verbose_name='Имя ребенка')),
                ('last_name', models.CharField(blank=True, max_length=100, null=True, verbose_name='Фамилия ребенка')),
                ('third_name', models.CharField(blank=True, max_length=100, null=True, verbose_name='Отчество ребенка')),
                ('birthday', models.DateField(blank=True, null=True, verbose_name='Дата рождения')),
                ('age', models.CharField(max_length=100, verbose_name='Возраст')),
                ('address', models.TextField(blank=True, max_length=1000, null=True, verbose_name='Адрес проживания')),
                ('characteristic', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Характеристика на ребенка')),
                ('preferences', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Предпочтения ребенка')),
                ('first_parent', models.CharField(max_length=255, verbose_name='Родитель')),
                ('second_parent', models.CharField(blank=True, max_length=255, null=True, verbose_name='Второй родитель')),
                ('contacts', models.CharField(blank=True, max_length=200, null=True, verbose_name='Контакты ребенка')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Дата добавления ребенка')),
                ('edited_date', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата редактирования')),
                ('deleted_date', models.DateTimeField(blank=True, null=True, verbose_name='Дата удаления')),
                ('communication_system', models.TextField(blank=True, max_length=1000, null=True, verbose_name='Система коммуникации')),
                ('is_deleted', models.BooleanField(default=False)),
            ],
            options={
                'verbose_name': 'Дети',
                'verbose_name_plural': 'Дети',
            },
        ),
        migrations.CreateModel(
            name='HintType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hint_type', models.CharField(blank=True, max_length=255, null=True, verbose_name='Вид подсказки')),
            ],
            options={
                'verbose_name': 'Вид подсказки',
                'verbose_name_plural': 'Виды подсказок',
            },
        ),
        migrations.CreateModel(
            name='HintTypeDelete',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hint_type_delete', models.CharField(blank=True, max_length=255, null=True, verbose_name='Способ удаления подсказки')),
            ],
            options={
                'verbose_name': 'Метод удаления подсказки',
                'verbose_name_plural': 'Методы удаления подсказки',
            },
        ),
        migrations.CreateModel(
            name='Program',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start_date', models.DateField(verbose_name='Дата начала')),
                ('end_date', models.DateField(verbose_name='Дата окончания')),
                ('status', models.CharField(choices=[('open', 'Открыта'), ('closed', 'Закрыта')], default='open', max_length=20, verbose_name='Статус')),
                ('name', models.CharField(blank=True, max_length=100, null=True, verbose_name='Название программы')),
                ('description', models.TextField(blank=True, max_length=2000, null=True, verbose_name='Описание программы')),
                ('comment', models.CharField(blank=True, max_length=255, null=True, verbose_name='Комментарий к программе')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('edited_date', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата редактирования')),
                ('deleted_date', models.DateTimeField(blank=True, null=True, verbose_name='Дата удаления')),
                ('is_deleted', models.BooleanField(default=False)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='programs', to=settings.AUTH_USER_MODEL, verbose_name='Автор')),
                ('child', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='programs', to='webapp.Child', verbose_name='Ребенок')),
            ],
            options={
                'verbose_name': 'Программа',
                'verbose_name_plural': 'Программы',
            },
        ),
        migrations.CreateModel(
            name='ProgramSkill',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_creteria', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Дополнительные критерии')),
                ('status', models.CharField(choices=[('open', 'Открыт'), ('closed', 'Закрыт')], default='open', max_length=20, verbose_name='Статус')),
            ],
            options={
                'verbose_name': 'Программа ребенка',
                'verbose_name_plural': 'Программы ребенка',
            },
        ),
        migrations.CreateModel(
            name='Session',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment', models.TextField(blank=True, max_length=1000, null=True, verbose_name='Комментарий')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('edited_date', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата редактирования')),
                ('deleted_date', models.DateTimeField(blank=True, null=True, verbose_name='Дата удаления')),
                ('status', models.CharField(choices=[('open', 'Открыта'), ('closed', 'Закрыта')], default='open', max_length=20, verbose_name='Статус')),
                ('child', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, related_name='sessions', to='webapp.Child', verbose_name='Ребёнок')),
                ('program', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='sessions', to='webapp.Program', verbose_name='Программа')),
                ('therapist', models.ForeignKey(blank=True, on_delete=django.db.models.deletion.PROTECT, related_name='sessions', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Сессия',
                'verbose_name_plural': 'Сессии',
            },
        ),
        migrations.CreateModel(
            name='SessionSkill',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stimulus', models.TextField(blank=True, max_length=200, null=True, verbose_name='Стимул')),
                ('status', models.CharField(choices=[('open', 'Открыт'), ('closed', 'Закрыт')], default='open', max_length=20, verbose_name='Статус')),
                ('done_self', models.PositiveSmallIntegerField(default=0, verbose_name='Самостоятельные реакции')),
                ('done_with_hint', models.PositiveSmallIntegerField(default=0, verbose_name='Реакции с подсказкой')),
                ('parent_skill', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dependant_skills', to='webapp.SessionSkill', verbose_name='Поднавык для')),
                ('session', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='skills', to='webapp.Session', verbose_name='Сессия')),
            ],
            options={
                'verbose_name': 'Навыки для отработки',
                'verbose_name_plural': 'Навыки для отработки',
            },
        ),
        migrations.CreateModel(
            name='Skill',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(blank=True, max_length=5, null=True, verbose_name='Код навыка')),
                ('name', models.CharField(max_length=255, verbose_name='Название навыка')),
                ('description', models.TextField(blank=True, max_length=1000, null=True, verbose_name='Описание навыка')),
                ('max_level', models.PositiveSmallIntegerField(default=1, verbose_name='Количество уровней сложности')),
                ('category', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='skills', to='webapp.Category', verbose_name='Секция')),
            ],
            options={
                'verbose_name': 'Навык',
                'verbose_name_plural': 'Навыки',
                'ordering': ('id',),
            },
        ),
        migrations.CreateModel(
            name='SkillLevel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('level', models.IntegerField(verbose_name='Уровень')),
                ('criteria', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Критерии')),
                ('skill', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='levels', to='webapp.Skill', verbose_name='Навык')),
            ],
            options={
                'verbose_name': 'Уровень навыка',
                'verbose_name_plural': 'Уровни навыков',
                'ordering': ('skill', 'level'),
            },
        ),
        migrations.CreateModel(
            name='StudyMethod',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('study_method', models.CharField(blank=True, max_length=255, null=True, verbose_name='Метод обучения')),
            ],
            options={
                'verbose_name': 'Метод обучения',
                'verbose_name_plural': 'Методы обучения',
            },
        ),
        migrations.CreateModel(
            name='Therapy',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('child', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='child_in_user', to='webapp.Child', verbose_name='Ребенок')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='related_to_user', to=settings.AUTH_USER_MODEL, verbose_name='Терапист')),
            ],
            options={
                'verbose_name': 'Дети пользователя',
                'verbose_name_plural': 'Дети пользователей',
            },
        ),
        migrations.CreateModel(
            name='Test',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_date', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Время изменения')),
                ('child', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='test', to='webapp.Child', verbose_name='Ребенок')),
                ('previus_test', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='webapp.Test', verbose_name='previus_test')),
                ('skill_level', models.ManyToManyField(blank=True, related_name='test', to='webapp.SkillLevel')),
                ('therapist', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='therapist', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Тестирование',
                'verbose_name_plural': 'Тестирование',
            },
        ),
        migrations.CreateModel(
            name='SessionSkillExtras',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mastery_criterion', models.CharField(blank=True, max_length=255, null=True, verbose_name='Критерий мастерства')),
                ('reinforcement_reaction', models.CharField(blank=True, max_length=255, null=True, verbose_name='Реакция для подкрепления')),
                ('reinforcement_mode', models.CharField(blank=True, max_length=255, null=True, verbose_name='Режим подкрепления')),
                ('hint_levels', models.CharField(blank=True, max_length=255, null=True, verbose_name='Уровень подсказки')),
                ('generalization', models.CharField(blank=True, max_length=255, null=True, verbose_name='Обобщение')),
                ('reaction_generalization', models.CharField(blank=True, max_length=255, null=True, verbose_name='Обобщение реакции')),
                ('stimulus_generalization', models.CharField(blank=True, max_length=255, null=True, verbose_name='Обобщение стимула')),
                ('hint_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='webapp.HintType', verbose_name='Вид подсказки')),
                ('hint_type_delete', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='webapp.HintTypeDelete', verbose_name='Способ удаления подсказки')),
                ('session_skill', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='extras', to='webapp.SessionSkill', verbose_name='Сессия')),
                ('study_method', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='webapp.StudyMethod', verbose_name='Метод обучения')),
            ],
            options={
                'verbose_name': 'Детали отработки',
                'verbose_name_plural': 'Детали отработки',
            },
        ),
        migrations.AddField(
            model_name='sessionskill',
            name='skill',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='in_sessions', to='webapp.Skill', verbose_name='Навык'),
        ),
        migrations.CreateModel(
            name='ProrgamSkillGoal',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('goal', models.CharField(max_length=1000, null=True, verbose_name='Дополнительная цель')),
                ('status', models.CharField(choices=[('open', 'Открыт'), ('closed', 'Закрыт')], default='open', max_length=20, verbose_name='Статус')),
                ('skill', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='goal', to='webapp.ProgramSkill', verbose_name='Уровень навыка')),
            ],
            options={
                'verbose_name': 'Дополнительная цель',
                'verbose_name_plural': 'Дополнительные цели',
            },
        ),
        migrations.AddField(
            model_name='programskill',
            name='level',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='program_skill', to='webapp.SkillLevel', verbose_name='Уровень навыка'),
        ),
        migrations.AddField(
            model_name='programskill',
            name='program',
            field=models.ForeignKey(blank=True, on_delete=django.db.models.deletion.CASCADE, related_name='program_skill', to='webapp.Program', verbose_name='Программа'),
        ),
        migrations.AddField(
            model_name='program',
            name='skills',
            field=models.ManyToManyField(blank=True, related_name='in_programs', through='webapp.ProgramSkill', to='webapp.SkillLevel', verbose_name='Навыки'),
        ),
        migrations.AddField(
            model_name='child',
            name='therapy',
            field=models.ManyToManyField(blank=True, related_name='therapists', through='webapp.Therapy', to=settings.AUTH_USER_MODEL, verbose_name='Ребенок'),
        ),
        migrations.AlterUniqueTogether(
            name='sessionskill',
            unique_together={('skill', 'stimulus')},
        ),
    ]
