# Generated by Django 5.2.3 on 2025-10-22 16:49

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


class Migration(migrations.Migration):

    dependencies = [
        ('problem', '0005_remove_spj_fields'),
        ('problemset', '0003_remove_badge_level'),
        ('submission', '0002_submission_user_create_time_idx'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterField(
            model_name='problemset',
            name='status',
            field=models.TextField(default='draft', verbose_name='状态'),
        ),
        migrations.CreateModel(
            name='ProblemSetSubmission',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('submit_time', models.DateTimeField(auto_now_add=True, verbose_name='提交时间')),
                ('result', models.IntegerField(verbose_name='提交结果')),
                ('score', models.IntegerField(default=0, verbose_name='得分')),
                ('language', models.CharField(max_length=20, verbose_name='编程语言')),
                ('code_length', models.IntegerField(default=0, verbose_name='代码长度')),
                ('execution_time', models.IntegerField(default=0, verbose_name='执行时间')),
                ('memory_usage', models.IntegerField(default=0, verbose_name='内存使用')),
                ('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='problem.problem', verbose_name='题目')),
                ('problemset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='problemset.problemset', verbose_name='题单')),
                ('submission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='submission.submission', verbose_name='提交记录')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='用户')),
            ],
            options={
                'verbose_name': '题单提交记录',
                'verbose_name_plural': '题单提交记录',
                'db_table': 'problemset_submission',
                'ordering': ('-submit_time',),
                'indexes': [models.Index(fields=['problemset', 'user'], name='problemset__problem_1f39fa_idx'), models.Index(fields=['problemset', 'problem'], name='problemset__problem_22f053_idx'), models.Index(fields=['user', 'submit_time'], name='problemset__user_id_63c1d0_idx')],
            },
        ),
    ]
