# Generated by Django 3.2.4 on 2021-07-06 15:02

import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='Belt',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('belt', models.CharField(max_length=50, verbose_name='Пояс')),
                ('color', models.CharField(max_length=60, null=True, verbose_name='Цвет')),
            ],
            options={
                'verbose_name': 'Пояс',
                'verbose_name_plural': 'Пояса',
            },
        ),
        migrations.CreateModel(
            name='Club',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='Название')),
                ('city', models.CharField(max_length=150, verbose_name='Город')),
                ('sportsmen', models.IntegerField(null=True, verbose_name='Количество спортсменов')),
            ],
        ),
        migrations.CreateModel(
            name='Filial',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(db_index=True, max_length=150, verbose_name='Имя филиала')),
                ('region', models.CharField(max_length=100, verbose_name='Регион')),
                ('city', models.CharField(max_length=60, verbose_name='Город')),
                ('address', models.CharField(max_length=150, null=True, verbose_name='Адрес')),
            ],
            options={
                'verbose_name': 'Филиал',
                'verbose_name_plural': 'Филиалы',
            },
        ),
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='Группа')),
                ('cost', models.IntegerField(default=4000, verbose_name='Стоимость')),
                ('filial', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='LK.filial', verbose_name='Филиал')),
            ],
            options={
                'verbose_name': 'Группа',
                'verbose_name_plural': 'Группы',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('bd', models.DateField(null=True, verbose_name='Дата рождения спортсмена')),
                ('phone', models.IntegerField(null=True, verbose_name='Телефон')),
                ('phone_dop', models.IntegerField(null=True, verbose_name='Дополнительный телефон')),
                ('first_name_m', models.CharField(blank=True, max_length=50, null=True, verbose_name='Имя матери')),
                ('last_name_m', models.CharField(blank=True, max_length=50, null=True, verbose_name='Фамилия матери')),
                ('first_name_f', models.CharField(blank=True, max_length=50, null=True, verbose_name='Имя отца')),
                ('last_name_f', models.CharField(blank=True, max_length=50, null=True, verbose_name='Фамилия отца')),
                ('belt', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='LK.belt', verbose_name='Пояс')),
                ('filial', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='LK.filial', verbose_name='Филиал')),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='LK.group', verbose_name='Группа')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'Пользователь',
                'verbose_name_plural': 'Пользователи',
            },
            managers=[
                ('objects', django.contrib.auth.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Trainers',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='ФИО')),
                ('belt', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='LK.belt', verbose_name='Пояс')),
                ('club', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='LK.club', verbose_name='Клуб')),
            ],
            options={
                'verbose_name': 'Инструктор',
                'verbose_name_plural': 'Инструктора',
            },
        ),
        migrations.CreateModel(
            name='Timetable',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=60, verbose_name='Название')),
                ('time_b', models.TimeField(verbose_name='Время начала')),
                ('time_e', models.TimeField(verbose_name='Время окончания')),
                ('day', models.CharField(choices=[('Пн', 'Понедельник'), ('Вт', 'Вторник'), ('Ср', 'Среда'), ('Чт', 'Четверг'), ('Пт', 'Пятница'), ('Суб', 'Суббота'), ('Вскр', 'Воскресенье')], default='Пн', max_length=4, verbose_name='День недели')),
                ('group', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='LK.group', verbose_name='Группа')),
            ],
            options={
                'verbose_name': 'Расписание',
                'verbose_name_plural': 'Расписание',
            },
        ),
        migrations.AddField(
            model_name='group',
            name='trainer',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='LK.trainers', verbose_name='Инструктор'),
        ),
        migrations.AddField(
            model_name='filial',
            name='trainer',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, to='LK.trainers', verbose_name='Тренер'),
        ),
    ]
