# Generated by Django 5.2.3 on 2025-06-14 08:51

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contest', '0001_initial'),
        ('problem', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Submission',
            fields=[
                ('id', models.TextField(db_index=True, default=utils.shortcuts.rand_str, primary_key=True, serialize=False)),
                ('create_time', models.DateTimeField(auto_now_add=True)),
                ('user_id', models.IntegerField(db_index=True)),
                ('username', models.TextField()),
                ('code', models.TextField()),
                ('result', models.IntegerField(db_index=True, default=6)),
                ('info', models.JSONField(default=dict)),
                ('language', models.TextField()),
                ('shared', models.BooleanField(default=False)),
                ('statistic_info', models.JSONField(default=dict)),
                ('ip', models.TextField(null=True)),
                ('contest', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='contest.contest')),
                ('problem', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='problem.problem')),
            ],
            options={
                'db_table': 'submission',
                'ordering': ('-create_time',),
            },
        ),
    ]
