# Generated manually to change subject from CharField to ForeignKey after data migration

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


class Migration(migrations.Migration):
    dependencies = [
        ('schedule', '0006_migrate_subject_data'),
    ]

    operations = [
        # Сначала удаляем старое поле subject (CharField)
        migrations.RemoveField(
            model_name='lesson',
            name='subject',
        ),
        migrations.RemoveField(
            model_name='lessontemplate',
            name='subject',
        ),
        # Затем добавляем новое поле subject (ForeignKey)
        migrations.AddField(
            model_name='lesson',
            name='subject',
            field=models.ForeignKey(
                blank=True,
                help_text='Общий предмет обучения',
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='lessons',
                to='schedule.subject',
                verbose_name='Предмет',
            ),
        ),
        migrations.AddField(
            model_name='lessontemplate',
            name='subject',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name='templates',
                to='schedule.subject',
                verbose_name='Предмет',
            ),
        ),
    ]




