# Generated by Django 3.0.11 on 2022-03-14 07:46

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields


class Migration(migrations.Migration):

    dependencies = [
        ('courses', '0059_update_course_format_and_mode'),
    ]

    operations = [
        migrations.CreateModel(
            name='CourseBlock',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('order', models.PositiveIntegerField(db_index=True, editable=False, verbose_name='order')),
                ('created', model_utils.fields.AutoCreatedField(default=django.utils.timezone.now, editable=False, verbose_name='created')),
                ('modified', model_utils.fields.AutoLastModifiedField(default=django.utils.timezone.now, editable=False, verbose_name='modified')),
                ('name', models.CharField(max_length=255, verbose_name='название')),
                ('summary', models.CharField(blank=True, max_length=500, verbose_name='краткое описание')),
                ('is_active', models.BooleanField(default=True, verbose_name='активен')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='blocks', to='courses.Course', verbose_name='курс')),
            ],
            options={
                'verbose_name': 'блок курса',
                'verbose_name_plural': 'блоки курсов',
                'ordering': ('order',),
            },
        ),
        migrations.AddField(
            model_name='coursemodule',
            name='block',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='modules', to='courses.CourseBlock', verbose_name='блок'),
        ),
    ]
