# Generated by Django 3.2.3 on 2021-06-02 17:43

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


class Migration(migrations.Migration):

    dependencies = [
        ('courses', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='course')),
                ('student', models.ManyToManyField(related_name='course_student', to=settings.AUTH_USER_MODEL, verbose_name='course_student')),
                ('teacher', models.ManyToManyField(related_name='course_teacher', to=settings.AUTH_USER_MODEL, verbose_name='course_teacher')),
            ],
        ),
        migrations.CreateModel(
            name='HomeWork',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('task', models.TextField(verbose_name='task')),
                ('solution', models.TextField(blank=True, verbose_name='solution')),
                ('is_done', models.BooleanField(default=False)),
                ('is_verified', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Mark',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.PositiveIntegerField(default=0, verbose_name='mark')),
                ('homework', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='marks_to_homework', to='courses.homework', verbose_name='homework')),
            ],
        ),
        migrations.CreateModel(
            name='Lecture',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(max_length=150, verbose_name='subject')),
                ('file', models.FileField(upload_to='uploads/')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lectures_to_course', to='courses.course', verbose_name='course')),
            ],
        ),
        migrations.AddField(
            model_name='homework',
            name='lecture',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='homework_to_lecture', to='courses.lecture', verbose_name='lecture'),
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(blank=True, verbose_name='task')),
                ('mark', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments_to_mark', to='courses.mark', verbose_name='mark')),
            ],
        ),
    ]
