# Generated by Django 3.1.5 on 2021-02-06 10:14

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


class Migration(migrations.Migration):

    dependencies = [
        ("school_office", "0018_auto_20200607_0750"),
    ]

    operations = [
        migrations.CreateModel(
            name="Class",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("establishment", models.DateField(verbose_name="Rocznik")),
                ("section", models.TextField(verbose_name="Sekcja")),
            ],
        ),
        migrations.CreateModel(
            name="Teacher",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("first_name", models.CharField(max_length=64, verbose_name="Imię")),
                ("last_name", models.CharField(max_length=64, verbose_name="Nazwisko")),
                (
                    "degree",
                    models.IntegerField(
                        choices=[
                            (0, "stażysta"),
                            (1, "kontraktowy"),
                            (2, "mianowany"),
                            (3, "dyplomowany"),
                        ],
                        verbose_name="Stopień",
                    ),
                ),
                (
                    "tel",
                    models.CharField(max_length=9, null=True, verbose_name="Telefon"),
                ),
                (
                    "email",
                    models.CharField(max_length=120, null=True, verbose_name="E-mail"),
                ),
                (
                    "classroom",
                    models.IntegerField(null=True, verbose_name="Przypisana sala"),
                ),
            ],
        ),
        migrations.AddField(
            model_name="parent",
            name="email",
            field=models.CharField(max_length=120, null=True, verbose_name="E-mail"),
        ),
        migrations.CreateModel(
            name="DateTeacher",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("start_date", models.DateField(verbose_name="Wychowawca od")),
                ("end_date", models.DateField(verbose_name="Wychowawca do")),
                ("active", models.BooleanField(verbose_name="Czy aktualny")),
                (
                    "class_of_students",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="school_office.class",
                        verbose_name="Klasa",
                    ),
                ),
                (
                    "teacher",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING,
                        to="school_office.teacher",
                        verbose_name="Nauczyciel",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="class",
            name="educator",
            field=models.ManyToManyField(
                through="school_office.DateTeacher", to="school_office.Teacher"
            ),
        ),
        migrations.AddField(
            model_name="recruit",
            name="students_class",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="school_office.class",
                verbose_name="Klasa",
            ),
        ),
    ]
