text: # Generated by Django 2.2.9 on 2020-04-07 09:12
  
  import datetime
  import django.contrib.postgres.fields
  from django.db import migrations, models
  import django.db.models.deletion
  import django.utils.timezone
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('account', '0003_auto_20200402_2104'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Contest',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('starts_at', models.DateTimeField()),
                  ('duration', models.DateTimeField(default=datetime.timedelta(seconds=7200))),
                  ('title', models.CharField(max_length=300)),
                  ('problem_set_size', models.PositiveIntegerField(default=1)),
                  ('active', models.BooleanField(default=False)),
                  ('completed', models.BooleanField(default=False)),
              ],
          ),
          migrations.CreateModel(
              name='ContestParticipant',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('penalty', models.IntegerField(default=0)),
                  ('task_solved', models.PositiveIntegerField(default=0)),
                  ('stats', django.contrib.postgres.fields.ArrayField(base_field=models.BooleanField(default=None), default=[None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None], size=16)),
                  ('contest', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='participants', to='contest.Contest')),
                  ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='account.UserProfile')),
              ],
              options={
                  'ordering': ('-task_solved', 'penalty'),
              },
          ),
          migrations.CreateModel(
              name='ContestTask',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('title', models.CharField(max_length=200)),
                  ('body', models.TextField()),
                  ('input', models.TextField()),
                  ('output', models.TextField()),
                  ('time_limit', models.PositiveIntegerField(default=1)),
                  ('memory_limit', models.PositiveIntegerField()),
                  ('solution', models.FileField(upload_to='code_files/')),
                  ('difficulty', models.CharField(choices=[('a', 'A'), ('b', 'B'), ('b1', 'B1'), ('b2', 'B2'), ('c', 'C'), ('c1', 'C1'), ('c2', 'C2'), ('d', 'D'), ('d1', 'D1'), ('d2', 'D2'), ('e', 'E'), ('e1', 'E1'), ('e2', 'E2'), ('f', 'F'), ('f1', 'F1'), ('f2', 'F2'), ('g', 'G'), ('h', 'H'), ('i', 'I'), ('j', 'J'), ('k', 'K'), ('l', 'L')], default='a', max_length=3)),
                  ('contest', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tasks', to='contest.Contest')),
              ],
              options={
                  'abstract': False,
              },
          ),
          migrations.CreateModel(
              name='ContestTest',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('content', models.TextField()),
                  ('answer', models.TextField()),
                  ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='tests', to='contest.ContestTask')),
              ],
              options={
                  'abstract': False,
              },
          ),
          migrations.CreateModel(
              name='ContestSolutionCase',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('package_time', models.DateTimeField(default=django.utils.timezone.now)),
                  ('task_file', models.FileField(upload_to='code_files/')),
                  ('verdict', models.CharField(default='Выполняется проверка', max_length=150)),
                  ('solved', models.BooleanField(default=False)),
                  ('participant', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='packages', to='contest.ContestParticipant')),
                  ('task', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='packages', to='contest.ContestTask')),
              ],
              options={
                  'ordering': ('-package_time',),
              },
          ),
      ]
  