# Generated by Django 2.2.4 on 2019-12-12 10:56

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


class Migration(migrations.Migration):

    dependencies = [
        ('organizations', '0069_auto_20191212_1521'),
        ('portal_users', '0045_auto_20191211_1526'),
        ('schedules', '0023_lessonteacher'),
    ]

    operations = [
        migrations.CreateModel(
            name='LessonStudent',
            fields=[
                ('uid', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False, unique=True, verbose_name='Уникальный идентификатор')),
                ('is_active', models.BooleanField(default=True)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('deleted', models.DateTimeField(blank=True, null=True)),
                ('flow_uid', models.UUIDField(verbose_name='UID потока')),
                ('group_identificator', models.CharField(help_text='УИД группы или название подгруппы', max_length=200, verbose_name='Идентификатор гр/подгр')),
                ('is_subgroup', models.BooleanField(default=False, verbose_name='Подгруппа')),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lesson_students', to='organizations.Group', verbose_name='Группа/Подгруппа')),
                ('parent_group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='organizations.Group', verbose_name='Родитель подгруппы')),
                ('student', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='portal_users.Profile', verbose_name='Студент')),
            ],
            options={
                'verbose_name': 'Студент Занятия',
                'verbose_name_plural': 'Студенты Занятии',
                'unique_together': {('flow_uid', 'group_identificator', 'student')},
            },
        ),
    ]
