# Generated by Django 3.1.6 on 2022-01-26 20:48

import common.mixins
from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("Scholarship", "0005_change_on_delete"),
    ]

    operations = [
        migrations.CreateModel(
            name="Course",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "catalog_code",
                    models.CharField(
                        max_length=10,
                        unique=True,
                        validators=[
                            django.core.validators.RegexValidator(regex="[A-Z]+[0-9]+")
                        ],
                    ),
                ),
                ("title", models.CharField(max_length=100)),
            ],
            bases=(common.mixins.ModelMixin, models.Model),
        ),
        migrations.CreateModel(
            name="CourseSection",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "term",
                    models.CharField(
                        choices=[
                            ("A", "A"),
                            ("B", "B"),
                            ("C", "C"),
                            ("D", "D"),
                            ("E", "E"),
                            ("S", "S"),
                            ("F", "F"),
                        ],
                        default="A",
                        max_length=1,
                    ),
                ),
                (
                    "year",
                    models.PositiveIntegerField(
                        validators=[django.core.validators.MaxValueValidator(99)]
                    ),
                ),
                ("professor", models.CharField(max_length=100)),
                (
                    "catalog_course",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="Scholarship.course",
                        to_field="catalog_code",
                    ),
                ),
                ("participants", models.ManyToManyField(to=settings.AUTH_USER_MODEL)),
            ],
            bases=(common.mixins.ModelMixin, models.Model),
        ),
    ]
