# Generated manually: модель файлов задания (прямая связь Homework → файл)

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('homework', '0008_homeworkaiagent_api_key_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='HomeworkAssignmentFile',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(max_length=500, upload_to='homework/assignment_files/%Y/%m/', verbose_name='Файл')),
                ('filename', models.CharField(max_length=255, verbose_name='Название файла')),
                ('file_size', models.BigIntegerField(verbose_name='Размер файла (bytes)')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Дата загрузки')),
                ('homework', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='assignment_files', to='homework.homework', verbose_name='Домашнее задание')),
                ('uploaded_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='uploaded_assignment_files', to=settings.AUTH_USER_MODEL, verbose_name='Загрузил')),
            ],
            options={
                'verbose_name': 'Файл задания',
                'verbose_name_plural': 'Файлы задания',
                'db_table': 'homework_assignment_files',
                'ordering': ['created_at'],
            },
        ),
    ]
